Created
June 16, 2010 15:26
-
-
Save gavinblair/440848 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//if animations crash due to excessive tapping, refresh the page | |
var crashchecker = setInterval(function(){ | |
if ($(".current").length == 0) { | |
window.location="/"; | |
clearInterval(crashchecker); | |
} | |
}, 500); |
The issue is that it crashes between animations and takes you to a black screen. If the page is installed as an app, there is no way to refresh - you'd have to quit and restart the app.
The good news is, jQTouch apps use ajax so things should be saved as you go.
Thats kinds lame... I guess your way makes sense then, but I think I would do $('body') instead just because then I don't have to go changing it for each project / page / whatever...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You might want to show a confirm() thing to make sure they know what is going on...
if (confirm('The page seems to have stopped responding properly, do you want to refresh the page? (you will lose all your unsaved data)')){/*refresh*/}
If they are entering data, they will lose it if you just randomly refresh the page on them.