新網頁為什么打不開呢?
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">??
? ?function openWindow(){
? ? ? var m=confirm("點擊確定");
? ? ? if(m==ture)
? ? ? {
? ? ? ? ? window.open('http://www.xianlaiwan.cn/','_blank','width=400,height=500,menubar=no')
? ? ? }
? ?}
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2020-09-20
其實你可以直接if(confirm('是否新窗口打開')){}?就行.?反正確定就是true?取消就false了
2020-09-20
true?不是ture? 我也總寫錯
2020-09-15
if(m==true),你的true寫錯了