Modify ↓
Ticket #6557 (closed bug: wontfix)
ajax async: false not honored for remote script loading
| Reported by: | gucki | Owned by: | |
|---|---|---|---|
| Priority: | Milestone: | 1.4.3 | |
| Component: | unfiled | Version: | 1.4.2 |
| Keywords: | ajax, async, synchronous | Cc: | |
| Blocking: | Blocked by: |
Description
$.ajax({ type: 'GET', url: ' http://api.recaptcha.net/js/recaptcha_ajax.js', dataType: 'script', async: false, success: function() { alert('a'); } }) alert('b');
The alertt'(b') gets fired before alert('a') which should never happen. Looking into the source it seems that the 'async' option is never used when $a.ajax detects s.dataType === "script" && type === "GET" && remote. See line 5062 of jquery.js
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Remote scripts are not handled by XMLHTTPRequest, since XHR cannot be used for cross-domain access. Instead a script tag is injected into the page.
I've closed this as wontfix, but it's really cantfix because of the technologies involved.