煩請各位大神再來看下這里哪出錯了,運行不了
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
function foo(){
? ? var bli=confirm('確定打開新世界的大門嗎?');
? ? if (bli==ture)
? ? ? ? ? ? {var url=prompt("在下面網址輸入key就可以啦",'http://www.bilibili.com/');
? ? ? ? ? ? if (url!=null)
? ? ? ? ? ? {window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');}
? ? ? ? else {alert('prompt關閉');}
? ? else {alert('confirm關閉');}
? ? }}
? </script>?
?</head>?
?<body>?
?<input type="button" value="打開新世界的大門" onclick="foo()" />?
?</body>
</html>
2016-10-16
第一:if語句里面應該是true而不是ture;
第二:prompt語句后面的分號要是英文輸入下的,你用的是中文狀態下的了;
第三:第一個else后面應該跟一個分號表示第一個if語句結束,你把它放到最后去了
2016-10-17
2016-10-16
上面說得都對,嘻嘻
2016-10-16
??content="text/html"?charset="gbk"/
?if(bil?!=?null)
2016-10-16
2016-10-16
window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');
多個)號