簡單的回答
function openWindow() ? ?{ ? ? ? ?var box; ? ? ? ?box=window.confirm("你要打開新的網頁嗎?"); ? ? ? ?if(box==1) ? ? ? ?{ ? ? ? ? ? ?box=window.prompt("請輸入網址","http://www.xianlaiwan.cn"); ? ? ? ? ? ?window.open(box); ? ? ? ?} ? ?}
function openWindow() ? ?{ ? ? ? ?var box; ? ? ? ?box=window.confirm("你要打開新的網頁嗎?"); ? ? ? ?if(box==1) ? ? ? ?{ ? ? ? ? ? ?box=window.prompt("請輸入網址","http://www.xianlaiwan.cn"); ? ? ? ? ? ?window.open(box); ? ? ? ?} ? ?}
2017-04-26
舉報
2017-04-26
function.openWindow()
{
? ?if(confirm("你要打開新的網頁嗎?"))
????{
? ? ? ?var box = prompt("請輸入網址","http://www.xianlaiwan.cn/")
? ? ? ?window.open(box)
????}
}
?if(box==1) 這個多余了,直接把判斷放到confirm里面
2017-04-26