代碼哪里有問題
function openWindow(){
? ? var chuankou=confirm("是否要打開新窗口"); ??
? ? ? ? if (chuankou==true)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? var wanzhi=prompt("請輸入需要打開窗口的名稱","http://www.xianlaiwan.cn/");
? ? ? ? ? ? ? ? window.open(wanzhi,'_top','width=400,height=600');
? ? ? ? ? ? }
? ? ? ?
? ? }
2015-07-29
這邏輯就不對,window.open()在mycc為true的分支里,說明只要是打開就會彈出http://www.xianlaiwan.cn/網址,你需 要在寫一個分支,來判斷address的值,咋確定是否打開新的窗口或者,網址是不是為空,或者是否點擊了prompt中的取消鍵,希望幫到你。