aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2006-12-29 13:49:28 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2006-12-29 13:49:28 +0000
commit666cc900643ac0779b5d1afd132b23d97f7f09e0 (patch)
tree01517c716a7e970f92c2c8a1560db3ee1703eb44 /src/ajax
parentb8d46f7b6a38d92d9e0ad0b0df12c773bcf1c634 (diff)
downloadjquery-666cc900643ac0779b5d1afd132b23d97f7f09e0.tar.gz
jquery-666cc900643ac0779b5d1afd132b23d97f7f09e0.zip
Fix for #534
Diffstat (limited to 'src/ajax')
-rw-r--r--src/ajax/ajax.js4
-rw-r--r--src/ajax/ajaxTest.js3
2 files changed, 6 insertions, 1 deletions
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" );
});