<!DOCTYPE?html>
<html>
?<head>
??<title>?new?document?</title>??
??<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"/>???
??<script?type="text/javascript">??
????function?openWindow()
????{var?mychar=confirm("是否打開網(wǎng)址");
????//?新窗口打開時(shí)彈出確認(rèn)框,是否打開
??????if(mychar==true)
??????{var?mystr=prompt("打開網(wǎng)址","http://idcbgp.cn");
??????if(mystr!=null)
????//?通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為?http://idcbgp.cn/
????????{window.open(mystr,"_blank",'height=500px,width=400px,munbar=no,toolbar=no');}
????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
????????else
????????{alert("無法打開");}
??????}
??????else
???????{alert("無法打開");}
????}???
????
??</script>?
?</head>?
?<body>?
??<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>?
?</body>
</html>
2017-01-24
confirm()函數(shù)后面的中文分號;改成英文分號。應(yīng)該是這個(gè)原因了