大嬸們,看看我這段代碼有什么問題,跪拜
function openWindow()
? ?{
? ?var open = confirm("shifou dakai?");
? ?// 新窗口打開時(shí)彈出確認(rèn)框,是否打開
? ?if(open==true)
? ? {var URL=prompt("shuruwangzhi","http://idcbgp.cn/");
? ? // 通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? if (URL!=true)
? ? {window.open(URL,'width=400px,height=500px,menubar=no,toolbar=no');}
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? else
? ? {alert("zaijian!");}
? ? }
? ?else
? ?{alert("zaijian!");}
? ?}?
2016-01-10
2016-01-10
有2個(gè)問題:第一個(gè)問題是網(wǎng)址:http://之間你多寫了一個(gè)空格,你重新寫一下;第二個(gè)問題是prompt中? if 的判斷語句是用 !=null 或者 ==null,而不是true或者false;應(yīng)該改寫為 if(URL!=null), 你可以看下我寫的
2016-01-10
2016-01-10
這里哪來的大嬸呀