Created
February 12, 2013 22:35
-
-
Save hannesoid/4774122 to your computer and use it in GitHub Desktop.
This is a simple example of an HTML with a javascript timer, which continues to be executed within a UIWebView after the container-app goes to background.
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
var counter = 0; | |
function increaseCounter() { | |
counter++; | |
document.getElementById("count").innerHTML = "" + counter; | |
} | |
setInterval(increaseCounter, 1000); | |
</script> | |
</head> | |
<body> | |
UIWebView has been alive for <span id="count"></span> seconds. | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment