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

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

這個題答完了,這樣對嗎

?var myopen=confirm('確認要打開網頁嗎?')

? ?if(myopen==true){

? ? ? ?window.open('http://idcbgp.cn/','width:400,height=500,menubar=no,toolbar=no')

? ?}else{

? ? ? ?myopen.close();

? ?}


正在回答

6 回答

<!DOCTYPE?html>
<html>?
<head>??
<title>?new?document?</title>????
<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"/>?????
<script?type="text/javascript">?
function?openWindow()
{??
var?value=?confirm("確認打開新窗口嗎");???
if(value==true)?
{???????
var?message?=?prompt("請輸入網址:");?????
if(message!=null)???????
{???????
window.open(message,'_blank','width=300,height=400,menubar=no,toolbar=no');?????
}???????
else????????
{???????????
window.open('http://idcbgp.cn','_blank','width=300,height=400,menubar=no,toolbar=no');??????
}???
}???
else????
{???????????
}??
}??????
</script>??
</head>??
<body>???????
<input?type="button"?value="新窗口打開網站"?onclick="openWindow()"?/>??
</body></html>

這個測試了,沒有問題,注意輸入網址的時候,要輸入完整地址,例如:http://www.baidu.com


0 回復 有任何疑惑可以回復我~
<!DOCTYPE?html><html>?<head>??<title>?new?document?</title>????<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"/>?????<script?type="text/javascript">??????????//?新窗口打開時彈出確認框,是否打開????//?通過輸入對話框,確定打開的網址,默認為?http://idcbgp.cn/????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。????function?openWindow(){	var?value=?confirm("確認打開新窗口嗎");	if(value==true)	{	????var?message?=?prompt("請輸入網址:");	????if(message!=null)	????{	????window.open(message,'_blank','width=300,height=400,menubar=no,toolbar=no');	????}	????else	????{	????????window.open('http://idcbgp.cn','_blank','width=300,height=400,menubar=no,toolbar=no');	????}	}	else	{	????	}??}??????</script>??</head>??<body>?	??<input?type="button"?value="新窗口打開網站"?onclick="openWindow()"?/>??</body></html>
這個測試了,沒有問題,注意輸入網址的時候,要輸入完整地址,例如:http://www.baidu.com


0 回復 有任何疑惑可以回復我~

難道你們都沒有看到默認打開網頁嗎?也就是說需要,輸入網頁的步驟:prompt

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>Document</title>

</head>

<body>

<script type="text/javascript">

var condition = confirm('是否打開新的網頁');

if(condition==true){

var address=prompt('請輸入網站:','http://idcbgp.cn/');

window.open('http://idcbgp.cn/');

}

</script>

</body>

</html>

這是按我理解寫的,但是彈出的新窗口含有前綴,,無法正確打開新的網頁

0 回復 有任何疑惑可以回復我~

<!DOCTYPE html>

<html>

?<head>

? <title> new document </title> ?

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

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

? ? function openWindow(){

? ?var mymessege=confirm("是否打開網站?")// 新窗口打開時彈出確認框,是否打開


? ? if(mymessege==true)// 通過輸入對話框,確定打開的網址,默認為 http://idcbgp.cn/


? ? {

? ? ? ? window.open('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no')?

? ? }//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。

? ??

? ? }

? </script>?

?</head>?

?<body>?

?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?

?</body>

</html>


0 回復 有任何疑惑可以回復我~

有和沒有效果是一樣的

0 回復 有任何疑惑可以回復我~

myopen.close()? ?不對吧? 不用寫else

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
JavaScript入門篇
  • 參與學習       741070    人
  • 解答問題       9811    個

JavaScript做為一名Web工程師的必備技術,本教程讓您快速入門

進入課程

這個題答完了,這樣對嗎

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號