Skip to main content

Bug Tracker

Side navigation

#1557 closed bug (fixed)

Opened August 31, 2007 12:25AM UTC

Closed November 29, 2007 07:11PM UTC

Last modified October 14, 2008 10:47AM UTC

$.ajax broken on cross-site XMLHttpRequests in Firefox 3

Reported by: ted.mielczarek Owned by: john
Priority: major Milestone: 1.2.2
Component: ajax Version: 1.2
Keywords: Cc:
Blocked by: Blocking:
Description

Trying to use jQuery's ajax method on a cross-site XMLHttpRequest fails because script is not allowed to call setHeader on these requests. The attached testcase tries to load http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox&json=1 using $.get, and fails.

Attachments (2)
  • jquery-ajax.html (0.4 KB) - added by ted.mielczarek August 31, 2007 12:26AM UTC.

    try to use $.get for cross-site-XHR

  • jquery_test.html (0.4 KB) - added by davidserduke November 29, 2007 07:09PM UTC.

    test case with getJSON instead of just get

Change History (3)

Changed August 31, 2007 12:47AM UTC by john comment:1

owner: → john

Throwing this in a try{} block should do the trick.

Changed November 29, 2007 07:11PM UTC by davidserduke comment:2

milestone: 1.21.2.2
need: ReviewPatch
resolution: → fixed
status: newclosed

Fixed in [3978]. This doesn't appear to have been just an FF3 problem and in fact didn't work in any browser. The fix was to add dataType == "json" as an allowable remote type. Check the changeset for details.

One problem with the above test case is it used $.get instead of $.getJSON. The new test case sets the dataType correctly.

Changed December 14, 2007 02:04AM UTC by john comment:3

version: 1.1.41.2

Actually, this ticket was in relation in something else. In Firefox 3 you can now do X-Domain XHR. Fixed, for real in SVN rev [4149].