那里出現錯誤了
<!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("是否打開新窗口?");
? ? ? if(open==true)
? ? ? {
? ? ? ? ? var url=prompt("通過輸入對話框,確定打開的網站","http://www.xianlaiwan.cn");
? ? ??
? ? ? if(url!=null)
? ? ? {
? ? ? window.open(url,"_blank",'width=400,height=500,menubar=no,toolbar=no');
? ? ? }
? ? ? else
? ? ? {
? ? ? ? ? alert("88!");
? ? ? }
? ? ? }
? ? ? else
? ? ? {
? ? ? ? ? alert("再見!");
? ? ? }
? }
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2018-10-12
var url=prompt("通過輸入對話框,確定打開的網站","http://www.xianlaiwan.cn");
var open=confirm("是否打開新窗口?");這兩處的;改成英文的。OK?
2018-10-11
不是"_blank",應該是'_blank'。引號問題。