Created
May 14, 2013 18:03
-
-
Save jdmansour/5578079 to your computer and use it in GitHub Desktop.
Test if the browser caches the current state of the document, or just the initial state. Open test.html, wait a few seconds, and click on the link. Then click the back button. The counter should be at the value it had when you left the page.
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> | |
<script> | |
function tick() { | |
var dyn = document.getElementById("dyn"); | |
var value = parseInt(dyn.innerHTML); | |
dyn.innerHTML = value + 1; | |
} | |
window.setInterval(tick, 1000); | |
</script> | |
</head> | |
<body> | |
<h1>Page 1</h2> | |
<p><a href="http://www.google.com">Go to Google.com</a></p> | |
<p>Seconds elapsed: <span id="dyn">0</span></p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment