JS page Reload (current page/Superior page) and frame or IFRAME element reference introduction _javascript Tips

Source: Internet
Author: User
Refresh the parent page and current page with JavaScript
Copy Code code as follows:

<script type= "Text/javascript" >
Refresh the parent page
Window.parent.main.document.location.reload ();
Refresh Current Page
Document.location.reload ();
</script>

Each frame element or IFRAME element is a frame, which is a window in which an HTML document is loaded. You can refer to a frame or an IFRAME element by using the following methods:
Copy Code code as follows:

Window.frames[index]
windows.frames["frame name"]
Windows. Frame Name

If you want to get a reference to a parent window from a Web page loaded by a frame, you can use the following method:
Copy Code code as follows:

Window.parent

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

Window.parent. Frame Name

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

Window.top

As long as you get a reference to the frame, you can manipulate the frame object!!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.