為什么我的無(wú)法運(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 openWindow()
{
var web1 = confirm("你需要打開(kāi)網(wǎng)址么?");
if (web1==true);
{
? ? var web2 = prompt('請(qǐng)輸入網(wǎng)址','http://www.baidu.com');
? ? window.open(web2,'_blank','width=100,height=300,menubar=no');
}
else{
? ? return flase;
}
? ? }
?
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2015-12-15
試試這個(gè),仔細(xì)看看你哪兒寫(xiě)錯(cuò)了。
2015-12-15
語(yǔ)法錯(cuò)誤,樓上已說(shuō)出了
2015-12-15
原代碼中這兩句,第一句最后的中文分號(hào)改為英文分號(hào),第二句if條件后面去掉分號(hào)。
然后是else與劇中的false寫(xiě)錯(cuò)了,改正即可。
2015-12-15
? return false;