為啥點取消還是能彈出網頁? 大神教我唄
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">??
? function xi(){
? ? var y=confirm("是否打開?");
? ?if(y=true)
? ? ? ?{
? ? ? ? ? ?window.open('http://www.xianlaiwan.cn/','width=400','height=500','menubar=no','toolbar=no');
? ? ? ? ? ?
? ? ? ?}
? ? else
? ? ? ? {
? ? ? ? ? ? alert("打開失敗!");
? ? ? ? ? ??
? ? ? ? }
? }
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網站" onclick="xi()" />?
?</body>
</html>
2019-02-12
==true
2019-02-03
alert本身就是一個警告彈窗啊