求大神,幫我解答一下我的哪錯了,感激不盡!
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>??
? <script type="text/javascript">?
??? function rec(){
??????? var mac=confirm("是否打開新窗口");
??????? if(mac==ture)
??????? {
??????????? var url=prompt("輸入對話框,打開新窗口","http://idcbgp.cn");
??????????? if(url!=null)
??????????? {
???????????? window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');
??????????? }
??????? else
??????? {
??????????? alert("再見");
??????? }
??? }
??????? else
??????? {
????????? alert("再見");
??????? }
??? }
??? rec();
? </script>
?</head>
?<body>
?? <input type="button" value="新窗口打開網站" onclick="rec()" />
?</body>
</html>
運行不出來。。。。
2018-05-27
是true,大兄dei