IOS 5 Safari JavaScript exceeded timeout

I am working on a mobile web application, which is primarily self-sufficient and is transmitted with the server only if necessary. The following libraries are currently used:

  • jQuery 1.6.4
  • jQuery UI 1.8.3
  • Changed / fixed version of jQTouch

Prior to the release of iOS 5, we also used touchscroll.js, but it is no longer needed, since Safari now supports the position: fixed and native scrolling.

Since the release of iOS 5, it would seem by chance that this exception has occurred:

JavaScript: Error undefined JavaScript execution exceeded timeout

Once it is uploaded, Safari will not run JS code that runs for more than a very short period of time (say, 1 ms). Updating a page, moving to a new page or moving to a new domain will not have any effect. Any and all JS codes, even as simple as

for(var i = 0; i < 30; i++) ;

will not be executed by the browser without exception. The only way around this is to get Safari to kill and restart it. I believe that you can also wrap any remote “heavy duty” code in the application in window.setTimeout (..., 1) or use web workers for everything except user interface updates, but this does not seem like a very good solution, since the application is quite large, and this will require substantial rewriting.

- ? - , - , , , Safari , , , ?

, - JS- Safari, :

var start, end;
start = new Date();

try {
   while(true);
} catch (ex) {
  alert('test');
}

end = new Date();
console.log(Number(end) - Number(start) + 'ms');

, , - JS, try/catch; , , . /JS ( UX), , , , 300 ( , "" ).

+5
1

watchPosition? . , : JavaScript

iOS 5 - !

0

All Articles