正解,不客氣
? ? function openWindow(){
? ? // 新窗口打開時彈出確認框,是否打開
? ? ? ? var openw = confirm("確定要打開窗口嗎?");
? ? ? ? if(openw == true){
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? ? ? ? ? var urllink = prompt('請輸入打開的網站','http://www.xianlaiwan.cn');
? ? ? ? ? ? if(urllink == null){
? ? ? ? ? ? ? ? return;
? ? ? ? ? ? }else{
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? ? ? ? ? ? ? window.open(urllink,'_blank','width=400px,height=500px,menubar=no,toolbar=no');
? ? ? ? ? ? }
? ? ? ? ? ? window.open('http//www.xianlaiwan.cn/','_blank','width=400px,height=500px,menubar=no,toolbar=no');
? ? ? ? }else if(openw == false){
? ? ? ? ? ? return;
? ? ? ? }
? ? }
? ??
2015-12-16
有點亂,會找開兩個相同的窗口呀?