Removed re-usability from jXHR object (no more open, send & onreadystatechange suppor...
[jquery.git] / src / transports / jsonp.js
index 6c9fb70..f16b394 100644 (file)
@@ -14,7 +14,7 @@ jQuery.ajaxSettings.jsonpCallback = function() {
 // 2) sneakily ensure transportDataType is json
 // 3) ensure options jsonp is always provided so that jsonp requests are always
 //    json request with the jsonp option set
-jQuery.xhr.prefilter("json jsonp", function(s) {
+jQuery.ajax.prefilter("json jsonp", function(s) {
        
        var transportDataType = s.dataTypes[ 0 ];
        
@@ -70,18 +70,16 @@ jQuery.xhr.prefilter("json jsonp", function(s) {
                }, s.complete ];
                                
                // Use data converter to retrieve json after script execution
-               s.dataConverters["script => json"] = function() {
+               s.dataConverters["script json"] = function() {
                        if ( ! responseContainer ) {
-                               jQuery.error("Callback '" + jsonpCallback + "' was not called");
+                               jQuery.error( jsonpCallback + " was not called" );
                        }
                        return responseContainer[ 0 ];
                };
                
                // Delegate to script transport
                return "script";
-               
        }
-
 });
 
 })( jQuery );