diff --git a/src/jquery.jsonp.js b/src/jquery.jsonp.js index 7400751..5024363 100644 --- a/src/jquery.jsonp.js +++ b/src/jquery.jsonp.js @@ -199,6 +199,9 @@ } else { + // reset lastValue (from stale aborts) + lastValue = void 0; + // Install the generic callback // (BEWARE: global namespace pollution ahoy) win[ successCallbackName ] = genericCallback; diff --git a/test/unit.js b/test/unit.js index 273bc25..51afce7 100644 --- a/test/unit.js +++ b/test/unit.js @@ -121,3 +121,116 @@ test( "stress test", function() { }); } }); + + + +function findHead(url1, url2) { + function rquote(str) { + return str.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); + }; + var t, obj, + reg1 = new RegExp(rquote(url1), "g"), + reg2 = url2 ? new RegExp(rquote(url2), "g") : null, + head = $( "head" )[ 0 ] || document.documentElement, + res = [], + children = head.children; + for (t=0;t