* Last-Modified header. Default value is false, ignoring the header.
*
* (Number) timeout - Local timeout to override global timeout, eg. to give a
- * single request a longer timeout while all others timeout after 1 seconds.
+ * single request a longer timeout while all others timeout after 1 second.
* See $.ajaxTimeout() for global timeouts.
*
* (Boolean) global - Whether to trigger global AJAX event handlers for
// Fire the global callback
if( s.global )
jQuery.event.trigger( "ajaxSuccess", [xml, s] );
+ } else {
+ jQuery.handleError(s, xml, status);
}
} catch(e) {
status = "error";
// Determines if an XMLHttpRequest was successful or not
httpSuccess: function(r) {
- return !r.status && location.protocol == "file:" ||
- ( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
- jQuery.browser.safari && r.status == undefined;
+ try {
+ return !r.status && location.protocol == "file:" ||
+ ( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
+ jQuery.browser.safari && r.status == undefined;
+ } catch(e){}
+ return false;
},
// Determines if an XMLHttpRequest returns NotModified
httpNotModified: function(xml, url) {
- var xmlRes = xml.getResponseHeader("Last-Modified");
+ try {
+ var xmlRes = xml.getResponseHeader("Last-Modified");
- // Firefox always returns 200. check Last-Modified date
- return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
- jQuery.browser.safari && xml.status == undefined;
+ // Firefox always returns 200. check Last-Modified date
+ return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
+ jQuery.browser.safari && xml.status == undefined;
+ } catch(e){}
+ return false;
},
/* Get the data out of an XMLHttpRequest.