亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么會一直彈出新窗口?

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>window對象</title>

<script type="text/javascript">

function alert(){ ??

? ? alert("歡迎來到慕課網");

? ? window.open('http://www.xianlaiwan.cn','_blank','width=400px','hight=400px');

?

}


</script>

</head>

<body>

<form>

<input type="button" value="點擊我,打開新窗口" onclick=alert() />

</form>

</body>

</html>


正在回答

4 回答

應該就是網站本身出的問題? 在其他地方是能正常運行的 或者換個域名也能正常打開 和函數名并沒有關系?

0 回復 有任何疑惑可以回復我~

https://img1.sycdn.imooc.com//5ccf91140001bcc402640057.jpg函數名不能用alert吧

0 回復 有任何疑惑可以回復我~

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>window對象</title>

<script type="text/javascript">

alert("歡迎來到慕課網");

function openW(){

? ? window.open("http://www.xianlaiwan.cn","_blank","height=600px,width=400px");

}

</script>

</head>

<body>

<form>

<input type="button" value="點擊我,打開新窗口" onclick="openW()" />

</form>

</body>

</html>


0 回復 有任何疑惑可以回復我~

你這函數名不要起alert(),alert本來就不是彈框的內置函數。。你自己怎么又定義一個呢。。函數起名的規則建議重新復習一下。。。

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么會一直彈出新窗口?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號