js-Popup A new window new window automatically transfers to a page and then closes automatically

Source: Internet
Author: User

The problem. Good.

In Baidu asked to find; his practice is to open a later through the instance object, then a jump, and then the JS in the timing of the instance object is closed ...

This problem actually does not need two pages, as long as three lines of JS code can be implemented, unless you in the 2.php also to do some articles. The following example opens a new window and turns off after google,5 seconds.

<script type= "Text/javascript" >
var popup = window.open (",");
popup.location.href= ' http://www.google.com/';
SetTimeout (function () {popup.close ();}, 5000);
</script>

If you need to open 2.php, replace the first line of code var popup = window.open (' 2.php ', ');

js-Popup A new window new window automatically transfers to a page and then closes automatically

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.