Created
September 22, 2014 02:30
-
-
Save byteface/8ee9cdc774d74d61a0d5 to your computer and use it in GitHub Desktop.
reload page javascript
This file contains hidden or 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
setTimeout( function(){ windowReload() }, 2000 ); | |
function windowReload(){ | |
if(!window.location.hash) { | |
window.location = window.location + '#loaded'; | |
window.location.reload(); | |
}else{ | |
if (history && history.pushState){ | |
history.pushState( null, null, window.location.href.split('#')[0] ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment