The following section describes how to compare href and replace in javascript ). I think this is quite good. Now I will share it with you and give you a reference. Let's take a look at the small Editor. When using javascript, sometimes you are too familiar with frequently used methods and ignore the nuances of their principles.
Example:
Window. location. href, window. location. replace.
Both methods allow the page to jump to a new page, but I ignore the details after the jump, such as the original page returned.
Window. location. the href in href is actually the href In the tag. After you use this to jump to the page, you can use the browser's back button to return to the original page, or you can use history. go (-1) function jumps to the original page.
The window. location. replace (url) method allows the browser to clear the historical URLs and reset the url settings. When the browser's back button or forward button is used, it will not jump to the original page, but to the previous page.
That is, the replace () method does not generate a new record in the History object. When this method is used, the new URL overwrites the current record in the History object.
The comparison of href and replace in the above javascript section (detailed description) is all the content shared by the editor. I hope to give you a reference and support for PHP.
For more information about the comparison of href and replace in javascript (detailed description), please follow the PHP Chinese website!