第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

window.close無法關(guān)閉新頁面。代碼如下

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>無標(biāo)題文檔</title>

<script type="text/javascript">

function Wopen(){

window.open('http://www.baidu.com','_blank','height=400,width=600,top=100dp,left=0dp');

window.close();

}

</script>

</head>


<body>

<input name="button" type="button" onClick="Wopen()" value="點(diǎn)擊我,打開新窗口!" / >

</body>

</html>


正在回答

2 回答

你這樣關(guān)閉的是你原來的那個(gè)頁面, 你應(yīng)該關(guān)閉的是你打開的那個(gè)頁面的對象

var mychar =window.open('http://www.baidu.com','_blank','height=400,width=600,top=100dp,left=0dp');

mychar.close();

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

champion666 提問者

請問,如果要在代碼中添加一行,頁面延遲3秒關(guān)閉。那代碼該如何寫?
2016-12-19 回復(fù) 有任何疑惑可以回復(fù)我~

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>close()</title>

? <script type="text/javascript">

? ? ?var mywin=window.open("http://idcbgp.cn");

? ? ?setInterval(function(){

? ? ? ? ?mywin.close();

? ? ? ? ?},3000);

? ? ? ??

? </script>

</head>

<body>

</body>

</html>


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

window.close無法關(guān)閉新頁面。代碼如下

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)