我這樣寫的。
?function openWindow()
? ? {
? ? ? ? var message= confirm("是否打開窗口");
? ? ? ? var url;
? ? ? ? if(message==true)
? ? ? ? {url=prompt("請輸入網址",'http://www.xianlaiwan.cn/');}
? ? ? ? window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no'); ?
? ? }
2015-12-14
? var status=confirm("您確定要打開慕課網");
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? if(status==true){
? ? ? ? window.open('http://www.xianlaiwan.cn','_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ??
? ? }
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。