js jump in the method

javascript in location.href There are many uses, mainly as follows.

self.location.href = "/ url" to open the current page URL of the page
location.href = "/ url" to open the current page URL of the page
windows.location.href = "/ url" to open the current page URL of the page, the same as the three previous usage.
this.location.href = "/ url" to open the current page URL of the page
parent.location.href = "/ url" open a new page in the parent page
top.location.href = "/ url" open a new page in the Front Page

If a page customized frame, you can change the parent self top custom frame name, the effect is open url address in the frame window

In addition, window.location.href = window.location.href; and window.location.Reload (), and both refresh the current page. The difference is that if there are to submit data. When submitting data, window.location.Reload () you will be prompted to submit, window.location.href = window.location.href; it is submitting data to specified url

From: https://blog.csdn.net/sdta25196/article/details/78799338

Guess you like

Origin www.cnblogs.com/wjqbooks/p/12001707.html