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