alert()需要點兩次確定,求大神幫忙講解一下
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>window對象</title>
<script type="text/javascript">
var a=0;
window.alert("歡迎來到慕課網(wǎng)"+a++);
function newweb(){
? window.open("http://idcbgp.cn","_blank","width=600px,height=400px"); ?
}
</script>
</head>
<body>
<form>
<input type="button" value="點擊我,打開新窗口" onclick="newweb()" />
</form>
</body>
</html>
alert()顯示了兩次,但是通過a的顯示,能判斷代碼只執(zhí)行了一次。
2017-07-26
ok,已找到問題,慕課網(wǎng)的原因,正常運行的話 ? 只有一次
2017-07-26
同樣求解,難道是慕課網(wǎng)的BUG?