How to reload web page only one time after page load using javascript

javascript page reload one time


Some times we need to refresh the web page only one time just after loading. This is the javascript code which can be used for this purpose.


Use this code on head section or just below body section of your web page.


<script language="javascript">

window.onload = function() {

    if(!window.location.hash) {

        window.location = window.location + '#loaded';

        window.location.reload();

    }

}

</script>

Comments

Post a Comment