How can I reload the page using JavaScript?
I need a method that works in all browsers.
window.location.reload(); // If we needed to force the document to be fetched from the // web server again (such as where the document contents // change dynamically but cache control headers are not // configured properly), Firefox supports a non-standard // parameter that can be set to true to bypass the cache: //window.location.reload(true);
window.location.replace(window.location.pathname + window.location.search + window.location.hash); // does not create a history entry
window.location.href = window.location.pathname + window.location.search + window.location.hash; // creates a history entry
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With