檢查了很多遍都覺得沒問題但就是無法運行,大家?guī)臀铱聪?/h1>
<!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?open=confirm("是否打開?");
????//?通過輸入對話框,確定打開的網(wǎng)址,默認為?http://idcbgp.cn/
????if(open==true){
????var?newWin=prompt("打開本網(wǎng)址嗎","http://idcbgp.cn/");
????????if(newWin!=null)
????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄
????window.open(url,"_blank","width=400,height=500,toolbar=no,menubar=no");}
????}
??</script>?
?</head>?
?<body>?
???<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>?
?</body>
</html>
<!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?open=confirm("是否打開?"); ????//?通過輸入對話框,確定打開的網(wǎng)址,默認為?http://idcbgp.cn/ ????if(open==true){ ????var?newWin=prompt("打開本網(wǎng)址嗎","http://idcbgp.cn/"); ????????if(newWin!=null) ????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄 ????window.open(url,"_blank","width=400,height=500,toolbar=no,menubar=no");} ????} ??</script>? ?</head>? ?<body>? ???<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>? ?</body> </html>
2018-01-25
解決啦? 是有一個逗號不是英文? 還有大括號的位置 ?? 大家要細心啊