2-7,點了打開 ‘新窗口打開網站’ 按鈕,發現一點用都沒有,求大神看看我錯在哪?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>confirm</title>
? <script type="text/javascript"> ?
? ? function Wopen()
? ? {
? ? ? ? var a;
? ? ? ? var b=confirm("是否打開");
? ? ? ? if(b==true)
? ? ? ? {
? ? ? ? var a =prompt("請輸入:http://www.xianlaiwan.cn/");
? ? ? ? ? if(a==http://www.xianlaiwan.cn/)
? ? ? ? ? {
? ? ? ? ? ? ? window.open('http://www.xianlaiwan.cn','width=400','heith=500','menubar=no','toolbar=no')
? ? ? ? ? }
? ? ? ? ??
? ? ? ? }
? ? }
? </script>?
?</head>?
?<body>?
??
? ? ? ?<input name="button" type="button" onClick="Wopen()" value="新窗口打開網站" />
?</body>
</html>
2016-10-11
function Wopen()
? ? {
? ? ? ??
? ? ? ? var b=confirm("是否打開");
? ? ? ? if(b==true)
? ? ? ? {
? ? ? ? var a =prompt("請輸入:http://www.xianlaiwan.cn/");
? ? ? ? ? if(a!=null)//此處
? ? ? ? ? {
? ? ? ? ? ? ? window.open('http://www.xianlaiwan.cn','_blank','width=400,heith=500,menubar=no,toolbar=no');//此處
? ? ? ? ? }
? ? ? ? ??
? ? ? ? }
? ? }
幫你改了一下
2016-10-11
window.open('http://www.xianlaiwan.cn','width=400','heith=500','menubar=no','toolbar=no')
你這句話里面的height寫錯了,還有就是在這句話后面加個分號要好一點
2016-10-09
if(a==''),加個單引號或雙引號吧