Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法让“loadedafter15seconds.com”在 20 秒后关闭?
代码在http://pastebin.com/480TtqJ9
基本上我想要一个转到页面的按钮。该页面在一定时间后加载网址列表,然后在一定时间后关闭它们。
Jsfiddle 上的演示
function closeWindow() { setTimeout(function() { window.close(); }, 15000); }
编辑
像这样使用它
function NewWindow3() { win = window.open('http://www.loadedafter15seconds.com') setTimeout(function() { win.close(); }, 20000); }