簡(jiǎn)單的回答
function openWindow() ? ?{ ? ? ? ?var box; ? ? ? ?box=window.confirm("你要打開(kāi)新的網(wǎng)頁(yè)嗎?"); ? ? ? ?if(box==1) ? ? ? ?{ ? ? ? ? ? ?box=window.prompt("請(qǐng)輸入網(wǎng)址","http://idcbgp.cn"); ? ? ? ? ? ?window.open(box); ? ? ? ?} ? ?}
2017-04-26
function.openWindow()
{
? ?if(confirm("你要打開(kāi)新的網(wǎng)頁(yè)嗎?"))
????{
? ? ? ?var box = prompt("請(qǐng)輸入網(wǎng)址","http://idcbgp.cn/")
? ? ? ?window.open(box)
????}
}
?if(box==1) 這個(gè)多余了,直接把判斷放到confirm里面
2017-04-26