為什么使用-self 這個(gè)參數(shù),窗口沒(méi)有反應(yīng)呢?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>window.open</title>
<script type="text/javascript">
? function Wopen(){
? ? ? var mymessage=confirm("點(diǎn)擊我,打開(kāi)新窗口!");
? ? ? if (mymessage=true)
? ? ? {
? ? ? ? window.open('http://idcbgp.cn','_self','width=400,height=600,top=200,left=200,menubar=yes,toolbar=yes, status=yes,scrollbars=yes');?
? ? ? }
? ? ? else
? ? ? {
? ? ? ? ? alert(" 請(qǐng)重新來(lái)一遍~");
? ? ? }
? }?
</script>
</head>
<body>
? ? <input name="button" type="button" onClick="Wopen()" value="點(diǎn)擊我,打開(kāi)新窗口!">
</body>
</html>
2019-05-14
可能是你的瀏覽器攔截了腳本
2019-01-17
_blank:在新窗口顯示目標(biāo)網(wǎng)頁(yè)
_self:在當(dāng)前窗口顯示目標(biāo)網(wǎng)頁(yè)
_top:框架網(wǎng)頁(yè)中在上部窗口中顯示目標(biāo)網(wǎng)頁(yè)