Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fetch file contents via AJAX without visible refresh spinner on iphone

I am developing a web app for iphone which requires the application to check for changes in a text file, and as soon as a change is detected, to complete certain actions.

The text file changes around once every 3 but the change has to be detected almost instantly and so I'm currently doing an ajax refresh every second.

This works perfectly on a desktop browser with no visible refresh noticeable, however on the iphone the activity spinner is practically constant.

Can this be suppressed? Or stopped?

N.B I'm currently using the jquery framework for ajax!

like image 768
Jordan Avatar asked Jun 21 '10 00:06

Jordan


1 Answers

No, using the xmlhttprequest object (jquery is based on this object) is going to envoke http traffic, which will cause the spinner to load.

Try polling a little less often and see if it stops.

Also you could try using websockets, however i'm not sure if this would still affect the spinner.

http://lukeredpath.co.uk/blog/pushing-events-to-your-iphone-using-websockets-and-pusher.html

Sidenote: the spinner is there to inform your users that they're requesting traffic, imo trying to block this user feed back is bad ux.

like image 182
Ben Rowe Avatar answered Oct 13 '22 17:10

Ben Rowe