Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

loading indicator on safari on iphone in long polling

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?

like image 244
Amir Avatar asked May 24 '11 01:05

Amir


2 Answers

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.

like image 50
Sajjan Sarkar Avatar answered Nov 18 '22 12:11

Sajjan Sarkar


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.

like image 25
khaverim Avatar answered Nov 18 '22 11:11

khaverim