為什么我的按鈕沒有反應(yīng)
<script type="text/javascript">
? ? ? ?function openWindow(){
? ? ? ? ? ?var message=confirm("是否打開對(duì)話框");
? ? ? ? ? ?if (message=="true")
? ? ? ? ? ?{ window.open('http://idcbgp.cn/',
? ? ? ? ? ? ? ? ? ?'width=400','height=500',menubar=no,toolbar=no}
? ? ? ?}
? ? ? ? ? ?else
? ? ? ? ? ?{alert("再見!");}
? ? ? ?}
? ?</script>
</head>
<body>
<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
</body>
2017-03-26
知道了,謝謝哈
2017-03-22
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>confirm</title>
? <script type="text/javascript">
? ? ? ?function openWindow(){
? ? ? ? ? ?var message=confirm("是否打開對(duì)話框");
? ? ? ? ? ?if (message==true){
? ? ? ? ? ?window.open('http://idcbgp.cn/',
? ? ? ? ? ? ? ? ? ?'width=400','height=500',menubar=no,toolbar=no);
? ? ? ? ? ?}
? ? ? ?
? ? ? ? ? ?else
? ? ? ? ? ?{alert("再見!");
? ? ? ? ? ? ? ?
? ? ? ? ? ?}
? ? ? ?}
? ?</script>
</head>
<body>
<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
</body>
</html>
if語句中true不是字符串 ?別打“”
?window.open('http://idcbgp.cn/',
? ? ? ? ? ? ? ? ? ?'width=400','height=500',menubar=no,toolbar ? ? ? ? ??);?????