- I am not doing a large chunk of computation in JS.
Everything works fine on iPad iOS 5 in Safari until I added this code:
var watchID = navigator.geolocation.watchPosition(updatePos,locationError,{maximumAge: 10000, frequency: 60000, enableHighAccuracy: true, timeout: 1000}); function updatePos(position) { if (position.coords.accuracy < accuracyThreshold) { $.post(websiteRoot + '/ReportDeviceLocation?rand=' + (Math.random() * Math.random()) + '&longitude=' + position.coords.longitude + '&latitude=' +position.coords.latitude); } else { console.debug("Location data is not accurate enough. Location not updated."); } }
Then the web page worked for about 4 minutes and I get this error:
JavaScript execution exceeded timeout.
Then no JavaScript would load. None of the debug messages I inserted into my.js file would print. Only the above error.
The error persists even after I left the page that generated this error, and opened other web pages under the same domain.
I used try and catch, I used setTimeout function, but neither gave me the source of the error nor solved the problem.
I don't know what the problem is. It has been burning me for the entire day and will be burning me for the weekend.