Common Javascript code for refreshing the complete set

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.jb51.net'; </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.jb51.net"; setTimeout ("flash ()", 1000);} // 1000 for one second
<Script> setTimeout ("location. href = http://www.jb51.net", 2000) </script>
<Script> setTimeout ("self. location. reload ();", 1000); <script> one second

Related Article

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.