把confirm()換了后就打不開(kāi)新窗口了,怎么回事啊
function btn(){
? ? var con = alert("你好!歡迎來(lái)到慕課網(wǎng)!") ?//把confirm()換了后就打不開(kāi)新窗口了,怎么回事啊
? ? if(con==true){
? ? ? ? window.open("http://idcbgp.cn","_blank","width=600,height=400");
? ? }else{
? ? ? ? alert("拜拜!") ? ?//結(jié)果是這個(gè)
? ? }
};
2016-08-08
alert的返回值時(shí)undefined. 所以con!=true,就不會(huì)執(zhí)行window.open("http://idcbgp.cn","_blank","width=600,height=400");
2016-10-20
alert()應(yīng)該只是純粹的彈窗把,confirm()才算是帶選擇的窗口吧
2016-08-21
首先非常感謝你的回答了