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

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

為什么總是同時打開兩個網(wǎng)頁而點(diǎn)按鈕卻只能關(guān)閉一個,哪位大神能幫我看看?代碼如下:

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

? ? ?function clk(){

? ? ? ? mywin.close();??

? ? ?}


? </script>

</head>

<body>

? ? <input name="button" type="button" onClick="clk()" value="點(diǎn)擊我,關(guān)閉網(wǎng)站" />

</body>


正在回答

3 回答

稍微改動了一下

<!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","_blank","width=600,height=400,top=100,left=0");

? ? ?function clk(x){

? ? ?x.close();

? ? ?}

? </script>

</head>

<body>

? ? ?<input name="button" type="button" onClick="clk(mywin)" value="點(diǎn)擊我,關(guān)閉網(wǎng)站" />

</body>

</html>


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

是青山

這個方法是錯的,不好意思了,沒有仔細(xì)驗(yàn)證就貼出來了
2018-07-15 回復(fù) 有任何疑惑可以回復(fù)我~

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>close()</title>
? <script type="text/javascript">
???? function clk(){
?????? var mywin=window.open("http://idcbgp.cn");
??????? mywin.close();?
???? }
?????
?</script>
</head>
<body>
??? <input name="button" type="button" onClick="clk()" value="點(diǎn)擊我,關(guān)閉網(wǎng)站" />
</body>
</html>

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

window.open()方法的作用就是新打開一個窗口,如果你想關(guān)閉當(dāng)前窗口直接用 onClick="window.close",如果是想兩個窗口同時關(guān)閉,需要在clk()函數(shù)中加一行window.close;

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

天臺理發(fā)師

還是關(guān)不了啊 T.T function clk(){ mywin.close(); window.close; } 這樣加不對嗎?
2018-06-27 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

為什么總是同時打開兩個網(wǎng)頁而點(diǎn)按鈕卻只能關(guān)閉一個,哪位大神能幫我看看?代碼如下:

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

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

幫助反饋 APP下載

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

公眾號

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