打開新網(wǎng)址,點擊取消,不會出現(xiàn)空白網(wǎng)頁
var temp=confirm("是否要打開新的網(wǎng)頁?"); ? ? ? ?if(temp){ ? ? ? ? ? open = prompt("請輸入你想打開的網(wǎng)址","http://idcbgp.cn/"); ? ? ? ? ? if(open){ ? ? ? ? ? window.open(open,'_blank','width=400,height=500,menubar=no,toolbar=no'); ? ? ? ? ? }else{ ? ? ? ? ? ? ? open.close(); ? ? ? ? ? } ? ? ? ?}
2016-07-14
?function openWindow(){
? ? // 新窗口打開時彈出確認(rèn)框,是否打開
? var test=confirm("是否打開窗口");
? if(test){
? ? ? var otxt=prompt("輸入你要打開的網(wǎng)站","http://idcbgp.cn");
? ? ? if(otxt!=null&&otxt!=""){
? ? ? ? ? window.open(otxt,"_blank","width=400,height=500,menubar=no,toolbar=no");
? ? ? }else{
? ? ? ? ? window.open("about:blank","_blank","width=400,height=500,menubar=no,toolbar=no")
? ? ? ? ? //alert("請輸入網(wǎng)址");
? ? ? }
? }
是第二步的時候出空白頁不?不太明白你的問題,反正我是讓它彈出空白頁,
2016-07-12
多寫多練,多測試