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