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

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

想尋求幫助 2-7的正確標(biāo)準(zhǔn)答案

想尋求幫助 2-7的正確標(biāo)準(zhǔn)答案

正在回答

10 回答

這是修改后的代碼,代碼里也貼了注釋,就是if嵌套加上語法調(diào)用


? <script type="text/javascript">

? ? function openWindow(){

? ? ? ? var mymessage=confirm("是否繼續(xù)打開該窗口");

? ? ? ? if(mymessage==true)

? ? ? ? {

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

? ? ? ? ? ? var wz=prompt("請輸入要訪問的網(wǎng)址,(需帶http://)默認(rèn)為http://idcbgp.cn/");

? ? ? ? ? ? if(wz!=null)? ? //若prompt的返回值不為null,即點確定,則繼續(xù),否則什么都不發(fā)生

? ? ? ? ? ? {

? ? ? ? ? ? ? ? if(wz!='')

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? window.open(wz,'_blank','width=400,height=500,menubar=no,toolbar=no');

? ? ? ? ? ? ? ? ? ? //若文本框輸入地址,則跳轉(zhuǎn)到文本框輸入的地址

? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? else

? ? ? ? ? ? ? ? {

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

? ? ? ? ? ? ? ? ? ? //若文本框沒輸入地址,則跳轉(zhuǎn)到imooc

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }


? ? ? ? }

? ? ? ? //若confirm的返回值為false,即不為true,則什么都不發(fā)生

? ? }

? ??

? ? // 新窗口打開時彈出確認(rèn)框,是否打開


? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/


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

? ??

? ??

? </script>?


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

最初的思念

第六行的window.close()可以刪掉,忘記刪了
2019-04-01 回復(fù) 有任何疑惑可以回復(fù)我~

給你參考下我剛剛做的把? ?

? <script type="text/javascript">

? ? function openWindow(){

? ? ? ? var mymessage=confirm("是否繼續(xù)打開該窗口");

? ? ? ? if(mymessage==false)

? ? ? ? {

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

? ? ? ? }

? ? ? ? var wz=prompt("請輸入要訪問的網(wǎng)址,(需帶http://)默認(rèn)為http://idcbgp.cn/");

? ? ? ? if(wz!='')

? ? ? ? {

? ? ? ? ? ? window.open(wz,'_blank','width=400,height=500,menubar=no,toolbar=no');

? ? ? ? }

? ? ? ? else

? ? ? ? {

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

? ? ? ? }

? ? }

? ??

? ? // 新窗口打開時彈出確認(rèn)框,是否打開


? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/


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

? ??

? ??

? </script>?


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

最初的思念

剛剛又測試了下發(fā)現(xiàn),忘記測試取消的情況了,尷尬
2019-04-01 回復(fù) 有任何疑惑可以回復(fù)我~

我來個簡單的

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

? ? function openWindow()

{

????if(confirm("確認(rèn)打開嗎?"))

????{

????????var myweb;

????????if(myweb=prompt("確認(rèn)訪問網(wǎng)站:","http://idcbgp.cn"))

????????????open(myweb,'_blank','width=400,height=500,menubar=no,toolbar=no');

????????else

????????????alert("hhh");

????}

}

? </script>?


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

<!DOCTYPE html>

<html>

?<head>

? <title> new document </title> ?

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

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

? function openWindow(){

? ? ? var addw=confirm("是否點擊確認(rèn):")

? ? ? if(addw==true){

? ? ? ? ? var add=prompt('請輸入網(wǎng)址:','http://www.baidu.com');

? ? ? ? ? if(add!=null){

? ? ? ? ? ? ? window.open(add,"_blank","width=400,height=500,menubar=no,toolbar=no")

? ? ? ? ? }

? ? ? ? ? else{

? ? ? ? ? ? ? alert("新窗口未打開!");

? ? ? ? ? }

? ? ? }

? ? ? else{

? ? ? ? ? alert("新窗口未打開!");

? ? ? }

? }

? ??

? ? // 新窗口打開時彈出確認(rèn)框,是否打開


? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/


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

? ??

? ??

? </script>?

?</head>?

?<body>?

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

?</body>

</html>


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

<!DOCTYPE html>
<html>
<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>??? <script type="text/javascript">?
???
??????? function openWindow(){
???????
??????? // 新窗口打開時彈出確認(rèn)框,是否打開???
??????? var fwin = confirm("是否要打開新的窗口");
??????? if(fwin==true){
?????????? var swin = prompt('請輸入目標(biāo)窗口地址:','');
???????
??????????? if(swin!=null&&swin!='')
??????????? {
??????????? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
??????????
??????????? window.open(swin,'_blank','width=400','height=500','menubar=no','toolbar=no','status=no');
?????????????
??????????? }
??????????? else
??????????? {
??????????? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
??????????? window.open('http://idcbgp.cn','_blank','width=400','height=500','menubar=no','toolbar=no', 'status=no');
??????????
??????????? }
??????? }
???????? else
???????? {
???????????? fwin.close();
???????????? //寫不寫都一樣,默認(rèn)都會關(guān)閉當(dāng)前窗口
???????? }
???????????
??????? }
????? </script> </head>
<body>??????? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
???
</body>
</html>



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

<!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 cc=confirm("是否打開?")

? ? ? ? if(cc==true)

? ? ? ? {

? ? ? ? ? ? var ss=prompt("輸入打開的網(wǎng)址","http://idcbgp.cn/")

? ? ? ? ? ? if(ss!=null)

? ? ? ? ? ? {

? ? ? ? ? ? window.open(ss,"_blank","width=400,height=500,menubar=no,toolbar=no");

? ? ? ? ? ? }

? ? ? ? ? ? else{

? ? ? ? ? ? ? ? alert("你點擊了取消");

? ? ? ? ? ? }

? ? ? ? }

? ? ? ? else

? ? ? ? {

? ? ? ? ? ? alert("你點擊了取消");

? ? ? ? }

? ? }


? ??

? </script>?

?</head>?

?<body>?

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

?</body>

</html>


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

<!DOCTYPE html>

<html>

?<head>

? <title> new document </title> ?

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

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

? ? function openWindow(){

? ? ? ? if(confirm("確認(rèn)彈出窗口嗎?")){

? ? ? ? ? ? var url = prompt("請輸入一個網(wǎng)址","http://idcbgp.cn/");?

window.open(url,"_blank","width=400,height=500,menubar=no,toolbar");

? ? ? ? }

? ? }

? ? // 新窗口打開時彈出確認(rèn)框,是否打開


? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/


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

? ??

? ??

? </script>?

?</head>?

?<body>?

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

?</body>

</html>


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

<!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 open = confirm("確定打開對話框");

? ? if(open==true)

? ? {

? ? ? ? var url = prompt("2","http://idcbgp.cn");

? ? ? ? if(url!=null)

? ? ? ? {

? ? ? ? ? ? window.open(url,'_blank','width=400,height=500,toolbar=no,menubar=no');

? ? ? ? }else

? ? ? ? {

? ? ? ? ? ? alert("內(nèi)層結(jié)束");

? ? ? ? }

? ? }else

? ? {

? ? ? ? alert("外層結(jié)束");

? ? }

}

? ??

? </script>?

?</head>?

?<body>?

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

?</body>

</html>


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

方式一:利用confirm消息點擊對話框??

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

?function openWindow(){ ??

?// 新窗口打開時彈出確認(rèn)框,是否打開

???var message=confirm("是否要打開慕課網(wǎng)?")

???if(message==true)

{

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

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

?}

//網(wǎng)頁彈出警告提示用戶

?else

????{

????????alert("您選擇取消是打不開慕課網(wǎng)的哦!")

????}

}

?????</script>

?

方式二:利用prompt消息輸入對話框

<script type="text/javascript"> ?

function openWindow(){

// 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/

var message=prompt("是否要打開慕課網(wǎng)?")

//輸入確定進(jìn)行下一步

if(message=="確定")

{

?// 新窗口打開時彈出確認(rèn)框,是否打開

?confirm("即將進(jìn)入慕課網(wǎng)!點擊確定繼續(xù)!")

//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。 ????window.open('http://idcbgp.cn/','width=400,height=500,menubar=no,toolbar=no') ??

???}

//輸入非確定則彈出提示框

else {

alert("您選擇取消進(jìn)入慕課網(wǎng)!")

????}

}

</script>?


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

<!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 message = confirm("是否打開慕課網(wǎng)?");

? ? ? if(message = true){

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

? ? ? }

? }

? ??

? ? // 新窗口打開時彈出確認(rèn)框,是否打開


? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/


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

? ? ? </script>?

?</head>?

?<body>?

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

?</body>

</html>


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

舉報

0/150
提交
取消
JavaScript入門篇
  • 參與學(xué)習(xí)       741104    人
  • 解答問題       9859    個

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

進(jìn)入課程

想尋求幫助 2-7的正確標(biāo)準(zhǔn)答案

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

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

幫助反饋 APP下載

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

公眾號

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