Created
December 2, 2010 10:03
-
-
Save sydlawrence/725065 to your computer and use it in GitHub Desktop.
using history pushState
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 lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<title>window.history.pushState Example</title> | |
</head> | |
<body> | |
<h1>window.history.pushState Example</h1> | |
<script type="text/javascript"> | |
/* | |
* this only works on same domain, for security reasons. | |
* Documentation: http://www.w3.org/TR/html5/history.html | |
* uses HTML5 javascript interface. | |
* browser support: http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(HTML_5)#APIs | |
*/ | |
window.history.pushState("", "Hello World", 'hello-world'); | |
document.title = "Hello World"; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment