Re: [問題] setTimeout & window.open & Chrome?
※ 引述《Xphenomenon (啦 )》之銘言:
: 請問一下,我想要設一個 timer 兩秒之後,自動開啟另外一個網頁,
: 下面的 javascript 在 IE 上是正常的,但是我假如使用 Chrome
: 開啟的話,第一行都沒辦法開啟,請問我要怎麼做才好呢?
: 麻煩大大為我解答一下,感謝!
: setTimeout("window.open('test.htm','test');",2000);
: setTimeout("alert('hello, chrome')", 2000);
字串是不能執行的。
setTimeout(function(){ window.open("test.htm", "test"); }, 2000);
setTimeout(function(){ alert("hello, chrome"); }, 2000);
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.137.37.197
推
08/10 21:00, , 1F
08/10 21:00, 1F
推
08/10 21:44, , 2F
08/10 21:44, 2F
推
08/11 11:52, , 3F
08/11 11:52, 3F
推
08/11 12:32, , 4F
08/11 12:32, 4F
推
08/11 12:56, , 5F
08/11 12:56, 5F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):