Javascript why does the page reload




















Learn about each function from its definition in this JavaScript cheat sheet. Complete guide on what is jQuery: find out what is jQuery used for and discover jQuery examples. Read this guide and learn what is jQuery. Code has been added to clipboard! Reading time 2 min. Contents 1. Using location. Example Copy. Try it Live. Previous Topic Next Topic. Strictly Necessary Cookies Always Active. Performance Cookies Performance Cookies. Functional Cookies Functional Cookies. Targeting Cookies Targeting Cookies.

Confirm My Choices. Clear Filters. Information storage and access. Consent Leg. Select All Vendors. All Consent Allowed. Consent Purposes. Location Based Ads Consent Allowed. Legitimate Interest Purposes. Personalize Require Opt-Out. Location Based Ads. Accept Cookies. Alternatively, you can use the false keyword to reload the page from the cache. You can also use JavaScript to refresh the page automatically after a given time period.

Here, we are refreshing the page 5 seconds after the page loads. This results in the page continuously refreshing every 5 seconds. You can achieve the same effect using the HTML meta tag. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to reload a page using JavaScript Ask Question. Asked 11 years, 2 months ago. Active 7 days ago. Viewed 1. How can I reload the page using JavaScript?

I need a method that works in all browsers. Improve this question. Braiam 4, 11 11 gold badges 50 50 silver badges 73 73 bronze badges. Resh Resh Add a comment. Active Oldest Votes. JavaScript 1. Improve this answer. It looks like location. If you are refreshing after an onclick then you'll need to return false directly after location. Fil 6, 12 12 gold badges 49 49 silver badges 75 75 bronze badges.

Lekensteyn Lekensteyn ShivanRaptor Usually none, in web browsers context, location is the same as window.



0コメント

  • 1000 / 1000