I am trying to make alert box after page reloaded, but it doesn\'t work. Please correct my code and tell me why?
$(\"button\").click(function(){ wind
You can use sessionStorage:
$( "button" ).click( function () { sessionStorage.reloadAfterPageLoad = true; window.location.reload(); } ); $( function () { if ( sessionStorage.reloadAfterPageLoad ) { alert( "Hello world" ); sessionStorage.reloadAfterPageLoad = false; } } );