Ticket #4777 (closed bug: fixed)
ajaxStop and ajaxStart not working
|Reported by:||scarlac||Owned by:|
|Keywords:||loader, ajax, jsonp, ajaxstart, ajaxstop||Cc:|
When using jsonp, jQuery.active is decremented twice due to the checks being made.
The reason perhaps lies in that the script.onload handler is called as well as the script.onreadystatechange. both of them decrement the jQuery.active counter.
This results in ajaxStart and ajaxStop being called once and after that the jQuery.active is negative which means neither of them are called afterwards.
I am logging this everywherein jquery.js where jQuery.active is incremented/decremented:
console.log('start, '+s.global + ", " + jQuery.active); // or this: console.log('stop, '+s.global + ", " + jQuery.active);
And my output from firebug is:
start, true, -1 GET http://localhost:8000/ap(...) calling complete in jsonp style stop in complete, true, -2 calling complete in onreadystatechange generic handler stop in complete, true, -3
I am using FF 3.0 and jQuery 1.3.2.