Help to squelch unnecessary Mozilla exceptions.
authorJohn Resig <jeresig@gmail.com>
Tue, 4 Jul 2006 01:23:18 +0000 (01:23 +0000)
committerJohn Resig <jeresig@gmail.com>
Tue, 4 Jul 2006 01:23:18 +0000 (01:23 +0000)
ajax/ajax.js

index af80810..f6a1d9e 100644 (file)
@@ -170,9 +170,12 @@ jQuery.ajax.active = 0;
 
 // Determines if an XMLHttpRequest was successful or not
 jQuery.httpSuccess = function(r) {
-       return r.status ?
-    ( r.status >= 200 && r.status < 300 ) || r.status == 304 :
-    location.protocol == "file:";
+  try {
+    return r.status ?
+      ( r.status >= 200 && r.status < 300 ) || r.status == 304 :
+      location.protocol == "file:";
+  } catch(e){}
+  return false;
 };
 
 // Get the data out of an XMLHttpRequest.