"Reload method" This method forces the browser to refresh the current page

Source: Internet
Author: User

"Reload method" This method forces the browser to refresh the current page

=================================================

the "One" requires a refreshed window with a name, such as ABC. On the page you want to close join

<body onunload= "Javascript:ABC.location.reload ()" >

"Two" if you want to refresh the parent window that will close the page, you can add the

<body onunload= "Javascript:window.opener.location.reload ()" >

"Three" refreshes the current, parent, topmost, specified time refresh object

Bind button Click event when page loads
$ (function () {
$ ("#按钮id"). Click (function () {
Refresh ();
});
});
Click the button to invoke the method
function Refresh () {
Window.location.reload ();//RefreshCurrentPage (forced refresh).
Parent.location.reload () Refreshes the Father object (forFrame)-need to be used within the IFRAME framework
Opener.location.reload () Refreshes the parent window object (forSingle OpenWindow
Top.location.reload () Refreshes the topmost object (formore openWindow

SetTimeout (' Refresh () ', 1000); //Specify 1 secondsRefresh Once
}

"Four" if you want to close the window when refreshing or when you want to open windows

<body onload= "Opener.location.reload ()" > Windows Refresh
<body onunload= "Opener.location.reload ()" > Refresh when off
<script language= "JavaScript" >
Window.opener.document.location.reload ()
</script>

"Five" auto refresh or Jump

1. Automatic page refresh: Add the following code to the
<meta http-equiv= "Refresh" content= ">"
20 refers to a refresh of the page every 20 seconds.

2. Page Auto-jump: Add the following code to the
<meta http-equiv= "Refresh" content= "20;url=http://www.baidu.com" >
Where 20 means jump to http://www.baidu.com page after 20 seconds

"Reload method" This method forces the browser to refresh the current page

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.