Once in a while, my Ajax calls (via JQuery 1.8) in my application are stuck with status "pending" for a long time (sometimes up to 17 minutes). I've googled it and all possible solutions didn't work:
Do you have a any idea how to solve this?
In the example below, the request was pending for 17 minutes (verified with Fiddler that it was sent only after 17 minutes).
GET http://www.mywebsite.com/foo/rest/publishers/1/packages?_=1421584749323 HTTP/1.1 Host: www.mywebsite.com Connection: keep-alive Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36 Content-Type: application/json Referer: http://www.mywebsite.com/foo/client/home Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8,he;q=0.6,ru;q=0.4 Cookie: JSESSIONID=C668509B5AFCDEBE9C9774C4721AFB9D; aaassz="ddss"
See image:
Just use ajax.abort(); } //then you make another ajax request $. ajax( //your code here );
ajax post method. The reason was my response was not in the JSON format so there was no need for the dataType: 'json' line in the submit method. In my case, the returned response was in text format that's why it was not going to success event. Solution: Remove dataType: 'json' line.
I have stumbled on exactly the same problem. As soon as I disabled:
Use a prediction service to load pages more quickly
Go Advanced Settings -> Privacy -> ca. 3rd checkbox, everything started to work as it should. I was unable to reproduce the error.
The jquery/ajax
poller works perfectly in Firefox. It's only Chrome - tested on Linux & Windows.
It is not a perfect solution, as it won't affect users in the global sense - but maybe you are in the same situation as I - limited audience.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With