I'm trying to do a long polling using XMLHttpRequest. it works fine on all supporting browsers, but for some reason on safari on iPhone i get the loading indicator for every ajax call, and for long polling thats a bit annoying.
I read that you need to wait until the document is loaded, but it doesn't seam to work. any other known hack to solve it?
I have had the same problem , I tried using simple XHRO, hidden iFrames etc , it just does not work on iPhone. It seems to not update the DOM or do anything until the the "entire" document is loaded which, in my example was the duration of the long poll.
The only thing I havent tried is JSONP. Maybe you can try JSONP.
Please let us know if u were able to try JSONP and if it worked or if anything worked at all!
UPDATE: I dont know why this is being marked as an answer, I dont think it is, so please let me know how to make it a comment instead of answer.
I have had the same problem as well.
Getting long-polling (or any polling really) to work on ALL browsers is a kick in the pants. And especially safari. Goodness.
socket.io is a solution.
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