為什么不彈出網(wǎng)頁
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>對話框事件</title>
</head>
<body>
<script type="text/javascript">
document.write("顯示彈出框"+"<br />");
alert("點擊確定關(guān)閉彈出框");
document.write("顯示對話框"+"<br />");
if(confirm("你愿意學(xué)習(xí)js嗎?")==true)
document.write("你很有前端"+"<br />")
else
document.write("你完了"+"<br />");
document.write("顯示提示對話框"+"<br />");
document.write("你需要的學(xué)習(xí)的技術(shù)是"+prompt("你需要學(xué)習(xí)什么?","請輸入相應(yīng)技術(shù)")+"<br />");
function open(){
window.open('http://idcbgp.cn','_blank','width=600,height=400,top=100,left=0')
}
</script>
? ?<input name="button" type="button" onclick="open()" value="點擊我,打開新窗口!" / >
</body>
</html>
2017-03-19
1、open() 是關(guān)鍵字,給方法重新取個名,比如open1();
2、<input name="button" type="button" onclick="open()" value="點擊我,打開新窗口!" / >最后的 / 和 >之間有一個空格,編譯器報錯
2017-03-18
你沒有調(diào)用函數(shù)