Bug #1584, ajaxStop/complete calls weren't called for JSONP requests.
[jquery.git] / src / ajax.js
index db877ab..a0bcf55 100644 (file)
@@ -78,7 +78,7 @@ jQuery.fn.extend({
                        var val = jQuery(this).val();
                        return val == null ? null :
                                val.constructor == Array ?
-                                       jQuery.map( val, function(i, val){
+                                       jQuery.map( val, function(val, i){
                                                return {name: elem.name, value: val};
                                        }) :
                                        {name: elem.name, value: val};
@@ -190,6 +190,7 @@ jQuery.extend({
                        window[ jsonp ] = function(tmp){
                                data = tmp;
                                success();
+                               complete();
                                // Garbage collect
                                window[ jsonp ] = undefined;
                                try{ delete window[ jsonp ]; } catch(e){}