大神幫忙看看,可以彈出對(duì)話框?yàn)槭裁磸棽怀鰜?lái)網(wǎng)頁(yè)
? ? function openWindow(){
? ?var liulanqi=confirm("是否打開(kāi)?"); // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
if (liulanqi==ture)
? ? {// 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ?window.open('idcbgp.cn','width=400','height=500','menubar=no',"toobar=no"); //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄
? ? }
? ? else
? ? {alert("謝謝")}
? ? }
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2018-08-08
window.open的參數(shù)格式不對(duì),width,height等這些參數(shù)全部用一個(gè)單引號(hào)括起來(lái)就可以了,我之前也是這樣的