為什么我的無法運行啊
<!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("你需要打開網址么?");
if (web1==true);
{
? ? var web2 = prompt('請輸入網址','http://www.baidu.com');
? ? window.open(web2,'_blank','width=100,height=300,menubar=no');
}
else{
? ? return flase;
}
? ? }
?
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2015-12-15
function?openWindow(){ ????????????var?open=confirm("是否在新窗口打開該網頁"); ????????????if(open==true){? ????????????????var?commu=prompt("請確認該網頁網址","http://www.xianlaiwan.cn"); ????????????}else{? ????????????????alert("退出"); ????????????} ????????????if(commu!=null){? ?????????????????window.open(commu,"_blank","width=400px,height=500px,menubar=no,toolbar=no"); ????????????}else{ ????????????????alert("退出"); ????????????} }試試這個,仔細看看你哪兒寫錯了。
2015-12-15
語法錯誤,樓上已說出了
2015-12-15
原代碼中這兩句,第一句最后的中文分號改為英文分號,第二句if條件后面去掉分號。
然后是else與劇中的false寫錯了,改正即可。
2015-12-15
? return false;