diff --git a/src/ajax/ajax.js b/src/ajax/ajax.js index c860b632b..e9f95340e 100644 --- a/src/ajax/ajax.js +++ b/src/ajax/ajax.js @@ -714,6 +714,10 @@ jQuery.extend({ jQuery.handleError(s, xml, null, e); } + // firefox 1.5 doesn't fire statechange for sync requests + if(!s.async) + onreadystatechange(); + // return XMLHttpRequest to allow aborting the request etc. return xml2; }, diff --git a/src/ajax/ajaxTest.js b/src/ajax/ajaxTest.js index 1ae6bbf3d..f530c1ce6 100644 --- a/src/ajax/ajaxTest.js +++ b/src/ajax/ajaxTest.js @@ -44,8 +44,9 @@ test("synchronous request", function() { }); test("synchronous request with callbacks", function() { + expect(2); var result; - $.ajax({url: "data/json.php", async: false, success: function(data) { result = data; } }); + $.ajax({url: "data/json.php", async: false, success: function(data) { ok(true, "sucess callback executed"); result = data; } }); ok( /^{ "data"/.test( result ), "check returned text" ); });