missing semi-colon
[jquery.git] / src / ajax / ajax.js
index 4b1e9b0..645caf7 100644 (file)
@@ -77,7 +77,7 @@ jQuery.fn.extend({
                        complete: function(res, status){
                                // If successful, inject the HTML into all the matched elements
                                if ( status == "success" || !ifModified && status == "notmodified" )
-                                       self.html(res.responseText)
+                                       self.html(res.responseText);
 
                                self.each( callback, [res.responseText, status, res] );
                        }
@@ -662,7 +662,7 @@ jQuery.extend({
                                        } else
                                                jQuery.handleError(s, xml, status);
                                } catch(e) {
-                                       status = "error";
+                                       status = "parsererror";
                                        jQuery.handleError(s, xml, status, e);
                                }
 
@@ -757,8 +757,11 @@ jQuery.extend({
         */
        httpData: function( r, type ) {
                var ct = r.getResponseHeader("content-type");
-               var data = !type && ct && ct.indexOf("xml") >= 0;
-               data = type == "xml" || data ? r.responseXML : r.responseText;
+               var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
+               data = xml ? r.responseXML : r.responseText;
+
+               if ( xml && data.documentElement.tagName == "parsererror" )
+                       throw "parsererror";
 
                // If the type is "script", eval it in global context
                if ( type == "script" )