為什么prompt執(zhí)行不了
function openWindow(){
? ? ? ? var m1=confirm("是否打開新網(wǎng)頁?");
? ? ? ? if(m1==ture)
? ? ? ? {
? ? ? ?var m2;
? ? ? ?m2=prompt("請你輸入你要打開的網(wǎng)址"+ m2);
? ? ?if(m2=="http://idcbgp.cn/")
? ? {
? ? ? ? ? ? window.open('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? }
? ??
}
}
2016-03-09
prompt有自己固定的格式,一個(gè)是交互的內(nèi)容,一個(gè)是固定的網(wǎng)址,+2沒有意義,
你要寫prompt("請輸入網(wǎng)址","http://idcbgp.cn");
2016-03-06
你的if語句漏了很多esle把?你試試把else都補(bǔ)全試試
2016-03-06
?m2=prompt("請你輸入你要打開的網(wǎng)址"+ m2); 這行后面+m2什么意思?