誰(shuí)幫我看下為什么我否則沒設(shè)置為什么還是會(huì)打開網(wǎ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 mywin=confirm("是否打開?");
if (mywin=true)
{
window.open('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no')
}
else
{
}
}
// 新窗口打開時(shí)彈出確認(rèn)框,是否打開
// 通過(guò)輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
//打開的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
</script>
</head>
<body>
<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
</body>
</html>
2020-08-10
if(mywin == true) 或者 if(mywin)? ?mywin本來(lái)就是boolean