Reload On Click Function Not Working In Javascript
I have a button on my page that needs to reload on click and it's not doing so. https://codepen.io/JammyPiece/full/dBZaMP It should also reload on click after the 'death screen' wh
Solution 1:
I think CodePen removed that function.
Use history
as alternative method,
The parameter 0 indicates the number of steps to go back.
function refreshPage(){
history.go(0);
}
OR
Use
functionrefreshPage(){
window.location.href = window.location.href;
}
This will reset the location to the same. Page will refresh.
Post a Comment for "Reload On Click Function Not Working In Javascript"