真的不知道哪里不對了
function openWindow()
? {
? ?var ask=confirm("真的要打開嗎?")
if(ask==ture)
{
? ? var ag=prompt("確認一下","www.xianlaiwan.cn")
? ? if(ag!=null)
? ? ?window.open('http://www.xianlaiwan.cn','_blank','width=400,height=500,menubar=no,toolbars=no')
? ? ?else
? ? ?alert("拜拜")
}
?
?else
?alert("再見")
2019-02-10
你的函數沒有寫完整吧,格式很亂啊,還有你的if判斷,格式也是不對的,肯定生效不了。
if(條件){執行代碼塊}else{否則執行的代碼塊。}