諸位幫我看看哪里錯了,為什么prompt語句不顯示?
<!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 opentag=confirm("哥哥,打開一個新窗口嘛好不好?");
if(opentag==ture)
{var webaddress=prompt("輸入一下這個網址嘛好不好?","http://www.xianlaiwan.cn");
if(webaddress!=null)
? ? {window.open('http://www.xianlaiwan.cn','_blank','width=400, height=500, menubar=no, toolbar=no, scrollbars=yes');}
? ? else{
? ? alert("你是不是故意的?");
? ? alert("哼,再不喜歡你了!");
}}
? ? else
? ? {
? ? alert("你為什么不打開新窗口?");
? ? alert("哼,再不喜歡你了!");
}
}
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2016-03-28
if(opentag==ture)中的ture應該為true
2016-03-28
gaoxiao