救命啊問(wèn)題出在哪……連彈窗都沒(méi)有
<!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 a=confirm("是否打開(kāi)網(wǎng)頁(yè)");
???? if(a=true);
???? {var b=prompt("打開(kāi)網(wǎng)址","http://yifanck.cn/")};
???????? if(b=null);
???????? { window.open(_blank,'http://yifanck.cn/','width=400,height=500,menubar=no,toolbar=no'); }
???????? else{window.open(blank,b,'width=400,height=500,menubar=no,toolbar=no')};
????? else {};
}
? </script>
?</head>
?<body>
?? <input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />
?</body>
</html>
2018-07-19
你的if-else的寫法有問(wèn)題,分號(hào)不是這樣加的。而且要用“==”而不是“=”,“=”是賦值。你可以調(diào)整一下格式寫成這樣。
2018-07-19
還有的是open的參數(shù)順序有顛倒,應(yīng)該是open("url","名稱","參數(shù)列表");
所以應(yīng)該寫成:
2018-07-19
判斷是否為真時(shí),用==表示相等,一個(gè)=代表賦值。