Home >Web Front-end >JS Tutorial >Introduction to page reloading (current page/previous page) and reference to frame or iframe elements in js_javascript skills

Introduction to page reloading (current page/previous page) and reference to frame or iframe elements in js_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:43:021354browse

Use JavaScript to refresh the parent page and the current page

Copy code The code is as follows:



Each frame element or iframe element is a frame. This frame is a window, and an html document is loaded in this window. Use the following There are several ways to reference frame or iframe elements:
Copy code The code is as follows:

window .frames[index]
windows.frames["frame name"]
windows.frame name

If you want to get a reference to the parent window from the web page loaded by the frame, then You can use the following method:
Copy the code The code is as follows:

window.parent

If you want to reference a frame in the parent window, you can use the following method:
Copy code The code is as follows:

window.parent.Frame name

You can also use the following method to get a reference to the top frame of the parent window:
Copy the code The code is as follows:

window.top

As long as you get the right By referencing the frame, you can manipulate the frame object! ! !
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