<!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 open=confirm("確認新建窗口打開網(wǎng)站嗎?");? ? if(open==true) { var url=prompt("通過輸入對話框,確定打開的網(wǎng)址","http://idcbgp.cn"); if(url!=null){? ? window.open(url,"_blank",'width=400px,height=500px,menubar=no,toolbar=no'); ? ?}? ? else? ? {alert("88!");? ? }? ? } ??? ? else? ? {alert("再見!");? ? }? ? }? ? function closewindow()? ? {? ? ? ? var close = confirm("真的要點嗎?");? ? ? ? if(true == close)? ? ? ? {? ? ? ? ? ? window.close();? ? ? ? }? ? ? ? else? ? ? ? { ??? ? ? ? ? ? alert("打開新窗口咯!");? ? ? ? ? ?openWindow();? ? ? ? }? ? }? ??? ??? </script>??</head>??<body>? ?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" /> <br>? ? ? <input type="button" value="別點我" onclick="closewindow()"/>?</body></html>
if(open==true)這里面的條件TRUE什么意思 還有兩個等于號
qq_一杯冰咖啡_03336449
2016-09-05 17:22:13