使用window.open的时间间隔specifc后打开新窗口() [英] opening new windows after specifc interval of time using window.open()

查看:149
本文介绍了使用window.open的时间间隔specifc后打开新窗口()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找的JavaScript code将后自动的时间特定的时间间隔打开新标签页(窗口)。

我已经在这里几个网站,在此code,当我preSS的HTML页面上的按钮自动打开。

我想这些网站后特定的时间间隔开。
状,1日网站将打开,当用户将preSS按钮打开Windows
2分钟后,第2次网站1分钟后和第3次的网站。

如:

 < HTML和GT;
< HEAD>
<脚本类型=文/ JavaScript的>
功能open_win(){
window.open(http://www.google.com)
window.open(http://www.yahoo.com)
window.open(http://www.bing.com)
}
< / SCRIPT>
< /头><身体GT;
<形式为GT;
<输入类型=按钮值=打开Windows的onclick =open_win()>
< /表及GT;
< /身体GT;< / HTML>

感谢您,

SANGRAM


解决方案

 )函数open_win({
    window.open(x.com);
    的setTimeout(window.open('y.com'),60000);
    的setTimeout(window.open('z.com'),120000);
}

这在一分钟后y.com开x.com然后和两个后应该打开z.com。

I am looking for javascript code which will open new tabs(windows) automatically after specific interval of time.

i have few websites over here, in this code which open automatically when i press the button on the html page.

I want these websites to open after specific interval. like, 1st website will open when user will press button "Open Windows", 2 nd website after 1 minute and 3 rd websites after 2 minutes.

eg.

<html>
<head>
<script type="text/javascript">
function open_win() {
window.open("http://www.google.com")
window.open("http://www.yahoo.com")
window.open("http://www.bing.com")
}
</script>
</head>

<body>
<form>
<input type=button value="Open Windows" onclick="open_win()">
</form>
</body>

</html>

Thank you,

sangram

解决方案

function open_win() {
    window.open("x.com");
    setTimeout("window.open('y.com')",60000);
    setTimeout("window.open('z.com')",120000);
}

This should open x.com then after one minute y.com and after two it should open z.com.

这篇关于使用window.open的时间间隔specifc后打开新窗口()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆