煩請(qǐng)各位大神再來(lái)看下這里哪出錯(cuò)了,運(yùn)行不了
<!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('確定打開(kāi)新世界的大門嗎?');
? ? if (bli==ture)
? ? ? ? ? ? {var url=prompt("在下面網(wǎng)址輸入key就可以啦",'http://www.bilibili.com/');
? ? ? ? ? ? if (url!=null)
? ? ? ? ? ? {window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');}
? ? ? ? else {alert('prompt關(guān)閉');}
? ? else {alert('confirm關(guān)閉');}
? ? }}
? </script>?
?</head>?
?<body>?
?<input type="button" value="打開(kāi)新世界的大門" onclick="foo()" />?
?</body>
</html>
2016-10-16
第一:if語(yǔ)句里面應(yīng)該是true而不是ture;
第二:prompt語(yǔ)句后面的分號(hào)要是英文輸入下的,你用的是中文狀態(tài)下的了;
第三:第一個(gè)else后面應(yīng)該跟一個(gè)分號(hào)表示第一個(gè)if語(yǔ)句結(jié)束,你把它放到最后去了
2016-10-17
2016-10-16
上面說(shuō)得都對(duì),嘻嘻
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');
多個(gè))號(hào)