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