Both document. Location. href and document. Location. Replace can be switched from page a to page B, but their differences are:
After switching with document. Location. href, you can return to the original page.
After switching with document. Location. Replace, you cannot return it back to the original page.
For document. Location. href or other failback methods, I also found details,
Here is an example:
Assume there are three pages: a.htm B .htm c.htm.
A.htm has the following sentence: Document. Location. href = "/B .htm ";
B .htm has the following sentence: Document. Location. href = "/c.htm ";
Note that both of them can be switched back.
1: when switching from A to B and then to C, the actualIn MemoryThree pages are retained: A, B, and C.
2: when it is rolled back to B, the C page is cleared out of memory!
3: Roll Back again. When page a is reached, page B is also cleared out of memory!
4: When you go forward again (instead of switching, but forward) to page B,
The memory retains a and B.
>>> When a document is replaced by location. Replace (), it will be removed from the current historical object