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