哪里有問題嗎?怎么點按鈕不彈窗呢、、、
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">??
? ?function vre(){
? ? ? ?var soc=confirm("是否要打開新網址?");
? ? ? ?if (soc==true){window.open('http://www.xianlaiwan.cn/,width=400px,height=500px,toolbar=no,menubar=no');}
? ? ? ?else{}
? ?}
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2019-05-14
onclick是點擊之后調用后面寫的方法,你的方法名是vre(),所以應該改為onclick=“vre()”