提交后打開(kāi)新窗口尺寸不對(duì),但記事本存html文件就可以
<!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 i=confirm("請(qǐng)確認(rèn)是否要離開(kāi)本頁(yè)面?");
? ????? if (i==true){
i=prompt("請(qǐng)輸入您要打開(kāi)的網(wǎng)址","http://idcbgp.cn/");
? ? ? ????????? if (i!=null){
i=window.open(i,"_blank","width=400,height=500,menubar=no,toolbar=no");
}
}
}
? ??
? ??
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2020-03-06
取消賦值給i,直接寫(xiě)
看能不能解決你的問(wèn)題。