又找不到哪里錯了
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>window對象</title>
<script type="text/javascript">
function new()
{
??? var istrue=confirm("是否打開慕課網?");
??? if(istrue==true)
??? {
??? window.open('http://www.xianlaiwan.cn','_blank','width=600px,height=400px');
??? }
}
</script>
</head>
<body>
<form>
<input type="button" value="點擊我,打開新窗口"? onclick="new()"/>
</form>
</body>
</html>
2017-03-15
new 用作函數名 ?是關鍵字?在 JavaScript 中,一些標識符是保留關鍵字,不能用作變量名或函數名
2017-03-15
new是js中的關鍵字,不能用作函數名的,換一個函數名程序就能正常執行了。