Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
181
rated 0 times [  185] [ 4]  / answers: 1 / hits: 28390  / 14 Years ago, fri, july 16, 2010, 12:00:00

How do i check if the page has pending AJAX or HTTP GET/POST requests? I use javascript and/or python for this checking.



what i wanted to do is execute a script if a page has finished all requests. onload doesn't work for me, if you used firebugs net panel, you would know. onload fires when the page is loaded but there is a possibility that there are still pending request hanging around somewhere.



thank you in advance.


More From » python

 Answers
3

figured it out. thanks for the effort guys.
just plain and simple javascript.



interValRef = 0;

interValRef = setInterval(checkState();,100)

function checkState(){
if(document.readyState == 'complete'){
clearInterval(interValRef);
myFunc();
}
}

[#96212] Wednesday, July 14, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kareem

Total Points: 733
Total Questions: 110
Total Answers: 102

Location: Bermuda
Member since Thu, Apr 20, 2023
1 Year ago
;