Created
May 25, 2012 21:47
-
-
Save alunny/2790786 to your computer and use it in GitHub Desktop.
resume and online events
This file contains 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
<html> | |
<head></head> | |
<body> | |
<h1>Resume and Online Events Demo</h1> | |
<p>alerts should appear on these events</p> | |
</body> | |
<script src="phonegap.js"></script> | |
<script> | |
document.addEventListener('deviceready', function (e) { | |
document.addEventListener('resume', onResume, false); | |
function onResume() { | |
setTimeout(function() { | |
document.addEventListener("online", onOnline, false); | |
alert("resume"); | |
}, 0); | |
} | |
function onOnline() { | |
setTimeout(function() { | |
alert("online"); | |
}, 0); | |
} | |
}, false); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment