I have a web application that is designed to run on desktops and mobile device like the iPhone. It's always worked fine on iOS devices, until we upgraded one of our devices to iOS6 recently. Now we're seeing a weird bug that seems to be specific only to Safari on iOS6. It still works OK on iOS5 Safari, and it works OK on iOS6 Chrome.
The bug seemingly has to do with the way we are querying the server for updates. We've set up an Ajax call to occur every 5 seconds. The Ajax call returns new data, and the client side updates with the new data. The behavior we are seeing now in Safari/iOS6 is that the call happens instantly when the previous call returns, and the result is a page that is constantly refreshing and repainting, making it unusable. The little spinner is always going as well, making it look like the page never stops loading.
Here's the client-side JavaScript code setting it up:
$(document).ready(function(){
getUpdates();
var refresh = 5000;
setInterval("getUpdates()", refresh);
});
function getUpdates() {
$.post("status.jsp", {}, function(status){
// do client-side rendering here
}, "json");
}
Is this a bug in Safari? A bug in my code? Is there a workaround? My web app is useless on iPhones now, not a good situation. Thanks!