這樣可以了
function openWindow(){ ? ? ? ? ? var newwin = confirm('打開新窗口?'); ? ? ? ? ? if(newwin == true){ ? ? ? ? ? ? ?var p = ?prompt('請輸入網址', 'http://www.xianlaiwan.cn/'); ? ? ? ? ? ? ?if(p!==null) ? ? ? ? ? ? ? window.open(p, '_blank','width=400, height=500, menubar=no, toolbar=no'); ? ? ? ? ? } ? ? ? ?}
2016-09-14
var w=confirm();
? ? if(w==true){
? ? ? ? var nw=window.open('http://www.xianlaiwan.cn/','_blank','width=400px,height=500px,menubar=no,toolbar=no');??
? ? }else{
? ? ? ? nw.close();
? ? }
2016-09-14
? function openWindow(){
? ? // 新窗口打開時彈出確認框,是否打開
if (confirm("sure open windows?")){
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
var url = prompt("請輸入一個網址","http://www.xianlaiwan.cn/");
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? window.open( url,"_blank","toolbar=no, menubar=no, scrollbars=yes, ?width=400, height=400");
? ? }
}