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

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

為啥我點(diǎn)擊按鈕沒有任何效果

<!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");

? ? function close(){

? ? ? ? var answer=confirm("是否要關(guān)閉此窗口?");

? ? ? ? if(answer==true){

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

? ? ? ? ? ? ?alert("已關(guān)閉");

? ? ? ? }else

? ? ? ? {

? ? ? ? ? ? alert("關(guān)閉失敗");

? ? ? ? }

? ? }

? </script>

</head>

<body>

? ? <input type="submit" value="點(diǎn)擊關(guān)閉" onclick="close()"/>

</body>

</html>


正在回答

2 回答

<!DOCTYPE HTML>

<html>


<head>

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

? ? <title>close()</title>

? ? <script type="text/javascript">

? ? ? ? function ?Wopen() {

? ? ? ? ? ? var answer = confirm("是否要打開此窗口?");

? ? ? ? ? ? var main = window.open('http://idcbgp.cn','_blank');

? ? ? ? ? ? if (answer == true) {

? ? ? ? ? ? ? ? main.close();

? ? ? ? ? ? ? ? window.close();

? ? ? ? ? ? } else {

? ? ? ? ? ? ? ? alert("打開失敗");

? ? ? ? ? ? }

? ? ? ? ? ?

? ? ? ? }

? ? </script>

</head>


<body>

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

</body>


</html>

這樣就好了

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

我也是個(gè)web初學(xué)者,但是有編程經(jīng)驗(yàn),我覺得應(yīng)該是close是一個(gè)內(nèi)置的方法

<!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");


? ? function closeWindow(){


? ? ? ? var answer=confirm("是否要關(guān)閉此窗口?");


? ? ? ? if(answer==true){


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


? ? ? ? ? ? ?alert("已關(guān)閉");


? ? ? ? }else


? ? ? ? {


? ? ? ? ? ? alert("關(guān)閉失敗");


? ? ? ? }


? ? }


? </script>


</head>


<body>


? ? <input type="submit" value="點(diǎn)擊關(guān)閉" onclick="closeWindow()"/>


</body>


</html>

上面這樣是可以的,把close函數(shù)名換成別的就好了

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

tomorrow23

不對(duì)啊,沒有真正關(guān)閉窗口啊,這是可以運(yùn)行而已
2023-03-10 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為啥我點(diǎn)擊按鈕沒有任何效果

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

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

幫助反饋 APP下載

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

公眾號(hào)

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