Learning IE8 - hashchange event
HTML
<a href="#fun">This link points to #fun</a>
CSS
* {
font-family: sans-serif;
font-weight: bold;
}
JavaScript
window.onload = function () {
if (typeof history.pushState === "function") {
history.pushState("jibberish", null, null);
window.onpopstate = function () {
history.pushState('newjibberish', null, null);
// Handle the back (or forward) buttons here
// Will NOT handle refresh, use onbeforeunload for this.
};
}