2-7,點(diǎn)了打開(kāi) ‘新窗口打開(kāi)網(wǎng)站’ 按鈕,發(fā)現(xiàn)一點(diǎn)用都沒(méi)有,求大神看看我錯(cuò)在哪?
<!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("是否打開(kāi)");
? ? ? ? if(b==true)
? ? ? ? {
? ? ? ? var a =prompt("請(qǐng)輸入:http://idcbgp.cn/");
? ? ? ? ? if(a==http://idcbgp.cn/)
? ? ? ? ? {
? ? ? ? ? ? ? window.open('http://idcbgp.cn','width=400','heith=500','menubar=no','toolbar=no')
? ? ? ? ? }
? ? ? ? ??
? ? ? ? }
? ? }
? </script>?
?</head>?
?<body>?
??
? ? ? ?<input name="button" type="button" onClick="Wopen()" value="新窗口打開(kāi)網(wǎng)站" />
?</body>
</html>
2016-10-11
function Wopen()
? ? {
? ? ? ??
? ? ? ? var b=confirm("是否打開(kāi)");
? ? ? ? if(b==true)
? ? ? ? {
? ? ? ? var a =prompt("請(qǐng)輸入:http://idcbgp.cn/");
? ? ? ? ? if(a!=null)//此處
? ? ? ? ? {
? ? ? ? ? ? ? window.open('http://idcbgp.cn','_blank','width=400,heith=500,menubar=no,toolbar=no');//此處
? ? ? ? ? }
? ? ? ? ??
? ? ? ? }
? ? }
幫你改了一下
2016-10-11
window.open('http://idcbgp.cn','width=400','heith=500','menubar=no','toolbar=no')
你這句話里面的height寫(xiě)錯(cuò)了,還有就是在這句話后面加個(gè)分號(hào)要好一點(diǎn)
2016-10-09
if(a==''),加個(gè)單引號(hào)或雙引號(hào)吧