Home  >  Article  >  Web Front-end  >  Usage of js href_javascript skills

Usage of js href_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:27:192795browse

"window.location.href" and "location.href" are the jumps to this page

"parent.location.href" are the jumps to the previous page

"top.location.href "is the outermost page jump

Example:

If A, B, C, and D are all jsp, D is the iframe of C, C is the iframe of B, and B is A's iframe, if the js in D writes

"window.location.href", "location.href": D page jumps to

"parent.location.href": C page Jump

"top.location.href": Jump to page A

If there is a form in page D,

: Jump to page D after the form is submitted. Go to

: A new page pops up after the form is submitted

: Page C jumps after the form is submitted

: Page A jumps after the form is submitted Go to



Regarding page refresh, D page writes:


"parent.location.reload();": C page refresh (of course, also You can use the opener object of the child window to obtain the object of the parent window: window.opener.document.location.reload(); )



"top.location.reload();": A page refresh

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn