Skip to main content

Bug Tracker

Side navigation

#6557 closed bug (wontfix)

Opened May 11, 2010 08:53AM UTC

Closed May 14, 2010 04:46PM UTC

Last modified March 15, 2012 01:05PM UTC

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:
Blocked by: Blocking:
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

Attachments (0)
Change History (2)

Changed May 14, 2010 04:46PM UTC by dmethvin comment:1

resolution: → wontfix
status: newclosed

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.

Changed May 14, 2010 04:46PM UTC by dmethvin comment:2

I've updated the documentation for $.ajax to clarify that

async: false
cannot be used for cross-domain requests.