為啥按按鈕沒(méi)反應(yīng)?
<!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 wow=comfirm("???");
? ? if(wow=true)// 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? {var url=prompt("open it","http://yifanck.cn");
? if (url!=null) ?// 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://yifanck.cn/
? ? {window.open(url,"_blank",'width=400px,height=500px,menubar=no,toolbar=no');
}
? ?else?
? ?{alert("bye!");}
? ? ??
? }//打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ? ? ? else
? ? ? ? {alert("bye!!!");}
? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2019-07-08
你的http:冒號(hào)是中文的也不行,
要英文的http:才可以.
2019-07-08
wow=comfirm("???");函數(shù)是confirm()
2019-07-08
你里面if(wow=true)是不對(duì)的;這是賦值,不是比較。