Location. href in javascript has many usage methods, mainly as follows.
Self. location. href = "/url" the current page opens the URL page
Location. href = "/url" the current page opens the URL page
Windows. location. href = "/url": the current page opens the URL page. The previous three operations are the same.
This. location. href = "/url" the current page opens the URL page.
Parent. location. href = "/url" opens a new page on the parent page.
Top. location. href = "/url" opens a new page on the top page.
If the frame is customized on the page, you can replace parent self top with the name of the custom frame to open the url address in the frame window.
In addition, window. location. href = window. location. href; and window. location. Reload () both refresh the current page. The difference is whether data is submitted. When data is submitted, window. location. Reload () will prompt whether to submit. window. location. href = window. location. href; then the data is submitted to the specified url.