Skip to main content

Bug Tracker

Side navigation

#1584 closed bug (fixed)

Opened September 11, 2007 03:22PM UTC

Closed October 17, 2007 11:13PM UTC

Last modified March 15, 2012 01:27AM UTC

cross-domain get[Script|JSON] not trigger ajaxStop

Reported by: MiRacLe Owned by:
Priority: minor Milestone: 1.2.2
Component: ajax Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:
Description

script.onload = script.onreadystatechange = function(){

if ( !done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) {

done = true;

----------------patch----------

if ( s.global) {

jQuery.active--;

jQuery.event.trigger('ajaxStop');

}

if (s.success && jQuery.isFunction(s.success)) s.success();

if (s.complete && jQuery.isFunction(s.complete)) s.complete();

--------------end-patch----------

head.removeChild( script );

}

};

Attachments (0)
Change History (4)

Changed September 15, 2007 12:35AM UTC by john comment:1

description: \ script.onload = script.onreadystatechange = function(){ \ if ( !done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { \ done = true; \ //----------------patch---------- \ if ( s.global) { \ jQuery.active--; \ jQuery.event.trigger('ajaxStop'); \ } \ if (s.success && jQuery.isFunction(s.success)) s.success(); \ if (s.complete && jQuery.isFunction(s.complete)) s.complete(); \ //--------------end-patch---------- \ head.removeChild( script ); \ } \ };script.onload = script.onreadystatechange = function(){ \ if ( !done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { \ done = true; \ //----------------patch---------- \ if ( s.global) { \ jQuery.active--; \ jQuery.event.trigger('ajaxStop'); \ } \ if (s.success && jQuery.isFunction(s.success)) s.success(); \ if (s.complete && jQuery.isFunction(s.complete)) s.complete(); \ //--------------end-patch---------- \ head.removeChild( script ); \ } \ };
resolution: → fixed
status: newclosed

I can't duplicate this at all - ajaxStop always fires for me, with both getScript and getJSON, both local and remotely.

HOWEVER - I was able to duplicate it with JSONP requests, and resolved the bug in SVN rev [3294]. Thanks for your help!

Changed September 18, 2007 01:15PM UTC by MiRacLe comment:2

resolution: fixed
status: closedreopened

hello again

i'm create two pages for demonstrate this bug:

http://rpz.name/jquery-bug/latest-jquery.html - ajaxStop never executed

http://rpz.name/jquery-bug/patched-jquery.html - work fine.

--------------------------diff--------------------------------------

--- jquery-1.2.1.js Tue Sep 18 16:06:43 2007

+++ jquery-patched.js Tue Sep 18 16:50:26 2007

@@ -2264,3 +2264,3 @@

// Handle Script loading

- if ( !jsonp && (s.success || s.complete) ) {

+ if ( !jsonp) {

var done = false;


Changed September 18, 2007 01:16PM UTC by MiRacLe comment:3

--- jquery-1.2.1.js
+++ jquery-patched.js
@@ -2264,3 +2264,3 @@
 			// Handle Script loading
-			if ( !jsonp && (s.success || s.complete) ) {
+			if ( !jsonp) {
 				var done = false;

Changed October 17, 2007 11:13PM UTC by john comment:4

milestone: 1.2.11.2.2
resolution: → fixed
status: reopenedclosed
version: 1.21.2.1

Fixed in SVN rev [3668].