Complete JavaScript refresh

Source: Internet
Author: User

I. Refresh this page

Foreground: <SCRIPT> window. Location. href = Window. Location. href; </SCRIPT>

Background: response. Write ("<SCRIPT> window. Location. href = Window. Location. href; </SCRIPT> ")

Ii. Refresh the parent page

Foreground: opener. Location. href = opener. Location. href; </SCRIPT>

Background: response. Write ("<SCRIPT> opener. Location. href = opener. Location. href; </SCRIPT> ")

3. Link to the specified webpage

Foreground: <SCRIPT> window. Location. href = 'HTTP: // www.cnblogs.com/yooolonet/'; </SCRIPT>

The window. navigate (Surl) method mentioned by msdn is for IE and does not apply to ff. In the HTML Dom window object, the window. navigate method is not listed at all.

Background: response. Write ("<SCRIPT> window. Location. href = 'yourpage. aspx '; </SCRIPT> ")

Or: Response. Write ("newurl ");

4. Refresh IFRAME

Foreground: <SCRIPT> IFRAME name or ID. Location. Reload (true); </SCRIPT>

 

5. timed refresh

Function flash () {window. Location. href = "http://www.cnblogs.com/yooolonet/"; setTimeout ("Flash ()", 1000);} // 1000 for one second

<SCRIPT> setTimeout ("location. href = http://www.cnblogs.com/yooolonet/", 2000) </SCRIPT>

<SCRIPT> setTimeout ("self. Location. Reload ();", 1000); <SCRIPT> one second

From http://www.cnblogs.com/yooolonet/archive/2009/11/21/1607590.html

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.