Difference between location. Replace and location. href and location. Reload

Source: Internet
Author: User

1. Location. Replace means replacement.

The principle of this method is to replace the current historical record with the URL of the new page, so that there is only one page in the browsing history record.
The return button will never become available

Onclick = "javascript: location. Replace (this. href );

<A href = "javascript: location. Replace ('HTTP: // www.baidu.com ')"> click this link to go to the new page and check whether the page can be returned. </a>

2. Location. href

This page jumps

Is the normal page adjustment A to B

3 location. ReloadMethod to force the browser to refresh the current page.

Method: location. Reload ([Bforceget]) Parameters:BforcegetOptional parameter. The default value is false. The current page is retrieved from the client cache. True, get the latest page from the Service side in the get format, which is equivalent to clicking F5 ("refresh") on the client ")

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.