Ticket #12023 (closed feature: wontfix)
Add new $.sjax method to explicitly support synchronous AJAX
|Reported by:||swaj||Owned by:|
Currently, the $.ajax method has an "async" option that has been marked as deprecated in jQuery 1.8 (see #11013). While using synchronous ajax is generally not the best idea, there are definitely some use cases where it is perfectly acceptable and valid (i.e. form validation on submit or the beforeunload event).
There has been some discussion about moving this functionality into a "compat" plugin, which could also cause some headaches because web developers would have to introduce another dependency just to restore functionality that is provided by the browser (and should ideally be wrapped by jQuery anyway).
While I understand that removing this "async" option from the $.ajax method will allow Promise implementation to proceed forward, I believe that the proper solution to this problem is to introduce a new method called $.sjax to provide synchronous AJAX capabilities. This would allow the work on Promises to proceed forward, and it would also allow developers to use synchronous AJAX when they truly need it. jQuery should provide this wrapper to ensure proper cross-browser functionality.
- Status changed from new to open
- Milestone changed from None to 1.8
- Priority changed from undecided to high
- Component changed from unfiled to ajax
- Status changed from open to closed
- Resolution set to wontfix