2.0: reduced xhr transport

This commit is contained in:
jaubourg
2013-01-02 22:55:41 +01:00
committed by Dave Methvin
parent c61150427f
commit 17049c73bc
2 changed files with 107 additions and 231 deletions

View File

@@ -1429,24 +1429,26 @@ module( "ajax", {
}
});
test( "#11743 - jQuery.ajax() - script, throws exception", 1, function() {
raises(function() {
jQuery.ajax({
url: "data/badjson.js",
dataType: "script",
throws: true,
// TODO find a way to test this asynchronously, too
async: false,
// Global events get confused by the exception
global: false,
success: function() {
ok( false, "Success." );
},
error: function() {
ok( false, "Error." );
}
});
}, "exception bubbled" );
asyncTest( "#11743 - jQuery.ajax() - script, throws exception", 1, function() {
var onerror = window.onerror;
window.onerror = function() {
ok( true, "Exception thrown" );
window.onerror = onerror;
start();
};
jQuery.ajax({
url: "data/badjson.js",
dataType: "script",
throws: true,
// Global events get confused by the exception
global: false,
success: function() {
ok( false, "Success." );
},
error: function() {
ok( false, "Error." );
}
});
});
jQuery.each( [ "method", "type" ], function( _, globalOption ) {