為什么提示沒(méi)有定義
<head> ??<title>?new?document?</title>?? ??<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"/>??? ???<script?type="text/javascript">?? ???? ????function?rec(){ ?????var?xgo?=?confirm("是否打開(kāi)?")??; ??????if(xgo==?true) ???{ ??????????document.write('123'); ??????} ??????else ??????{ ???????????document.write("123"); ??????} ????} ??</script>? ?</head>? ?<body>?; ???<input?name="button"?type="button"?onClick="rec()"?value="新窗口打開(kāi)網(wǎng)站"??/>? ?</body> </html>
2017-03-13
仔細(xì)檢測(cè)下的你的代碼,第9行的反括號(hào)你打錯(cuò)了,這是錯(cuò)誤的原因,你用的是中文的括號(hào),而且第21行你多了一個(gè)分號(hào),這個(gè)倒是沒(méi)啥影響
2017-03-13
這個(gè)是有提示的,可能是瀏覽器的兼容吧