哪里出錯了為什么都運行不了
?function winopen()
? {var open=confirm("是否在新窗口中打開網站?");
? if(open==true)
? {var url=prompt("是否輸入新網址?","http://www.xianlaiwan.cn");
? if(url!=null)
? {window.open(opp,"_blank",width=400px,height=500px,menubar=no,toolbar=no);
? }
? else
? {alert("結束");}
? }
? else
? {alert("結束");}
? } ??
2016-11-22
2016-11-22
function名winopen與onclick的openWindow不同;
window.open(opp,"_blank",width=400px,height=500px,menubar=no,toolbar=no)中opp是新變量,opp應為url;
width=400px,height=500px,menubar=no,toolbar=no應加引號
2016-11-22
window.open(url,"_black","width=400px,height=500px,menubar=no,toolbar=no");
切記加引號
2016-11-22
這是你的代碼,我改了一下,發現else有問題
2016-11-22
確定在input標簽中泄漏<input?type="button"?value="新窗口打開網站"?onclick="openWindow()"?/>?
里的onclick