Window.location.reload (false); Window.location.reload (true); Go (0) differences

Source: Internet
Author: User

The difference between the page refresh methods commonly used in daily work:
1 window.location.reload (FALSE);
First say Window.location.reload (false); when we window.location.reload (); default is false;
It first determines whether the file changes when the file is requested, based on the value of the header if-modified-since of the browser's HTTP request, and if not, updates to the page are found from the cache.

  If a form is present, the form form is resubmitted

2 Window.location.reload (TRUE);
This is different from false, regardless of the document's modification time, or there is no cache, it will be new on the server side of the request to update to the page.

  If a form is present, the form form is resubmitted

3 history. Go (0)
First of all, History,history is your access to the page and routing records, it will be updated in real-time to the history, when you History.go (XX), according to the recorded route matching the corresponding and cached pages, In other words, all history is called a page that has been cached.

4 Window.location.href = Window.location.href

The equivalent of requesting a URL again.

  If there is a form, the form data will not be submitted

Finally, the top left corner of the browser returns the arrow button
Its function is to return to the previous page, but the data returned after the page is not updated, the document is not updated.

Note: Window.location.reload (), Window.location.reload (True), history. Go (0), the data will be updated, the document is updated or not has been explained above.

Window.location.reload (false); Window.location.reload (true); Go (0) differences

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.