Jquery Countdown to achieve a jump to a specific page or close the window

JavaScript code:

 1     //设置超时时间为10秒钟
 2     var timeout = 10;
 3     function show() {
 4         var showbox = $(".showbox");
 5         showbox.html(timeout);
 6         timeout--;
 7         if (timeout == 0) {
 8             window.opener = null;
 9             window.location.href = "index.aspx";
10         }
11         else {
12             setTimeout("show()", 1000);
13         }
14     }

 Source: download

Reproduced in: https: //my.oschina.net/weisenz/blog/200642

Guess you like

Origin blog.csdn.net/weixin_34235105/article/details/91920883