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

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

最后一步網(wǎng)頁打不開怎么回事?

<!DOCTYPE?html>
<html>
?<head>
??<title>?new?document?</title>??
??<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"/>???
??<script?type="text/javascript">??
????function?openWindow(){
????????//?新窗口打開時(shí)彈出確認(rèn)框,是否打開
????????if(?confirm("確認(rèn)要打開新窗口嗎?")?==?true){
????????????var?url?=?prompt("請輸入一個(gè)網(wǎng)址:","http://idcbgp.cn");
????????}else{
????????????
????????}
????????if(url?==?true){
????????????window.open(url,'_blank','toolbar=no,?menubar=no,?scrollbars=yes,??width=400,?height=400');
????????}
????}
????//?通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為?http://idcbgp.cn/
????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
????
????
??</script>?
?</head>?
?<body>?
?<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>?
?</body>
</html>


正在回答

3 回答

將if(url?==?true)改為if(url!=null)就好了 ? ?url不是boolean數(shù)

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

Ticvory 提問者

雖然改了還是打不開,但我發(fā)現(xiàn)我哪里錯(cuò)了
2016-10-29 回復(fù) 有任何疑惑可以回復(fù)我~
#2

Ticvory 提問者

我突然意識到我沒必要用if判斷,管他對錯(cuò),讓瀏覽器判斷就好
2016-10-29 回復(fù) 有任何疑惑可以回復(fù)我~
#3

Ticvory 提問者

突然反應(yīng)過來點(diǎn)了取消怎么辦....還是有點(diǎn)小問題
2016-10-29 回復(fù) 有任何疑惑可以回復(fù)我~
#4

Ticvory 提問者

找到問題了,后面一個(gè)if沒有接else
2016-10-29 回復(fù) 有任何疑惑可以回復(fù)我~
#5

云計(jì)算王二狗

我邏輯是不是有錯(cuò)誤為什么要用 if(url!=true) 這個(gè)代碼的意思是不是如果這個(gè) 不是對的 就打開?
2016-11-03 回復(fù) 有任何疑惑可以回復(fù)我~
查看2條回復(fù)

<!DOCTYPE html>

<html>

?<head>

? <title> new document </title> ?

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

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

? ??

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

? ? function openWindow(){

? ??

? ? if(confirm("是否打開")==true)

? ? {

? ? var url1;

? ? url1=prompt("輸入網(wǎng)址","http://idcbgp.cn" )

? ? if(url1!=null)

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

? ??

? ??

? ? }

? ? else

? ? {}

? ? }


? ? // 通過輸入對話框,確定打開的網(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ù)我~
#1

Ticvory 提問者

window.open("url1","_blank","width=400","height=500","menubar=no","toolbar=no"); url1不能帶"",這是個(gè)變量,是要你打開變量代表的網(wǎng)址,不是讓你打開http://url1 。
2016-10-29 回復(fù) 有任何疑惑可以回復(fù)我~
#2

慕粉九星 回復(fù) Ticvory 提問者

萬分感謝<o.o>
2016-10-30 回復(fù) 有任何疑惑可以回復(fù)我~

將if(url?==?true)改為if(url!=null)就好了,但是不輸入網(wǎng)址此時(shí)依舊能打開啊???

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

舉報(bào)

0/150
提交
取消

最后一步網(wǎng)頁打不開怎么回事?

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

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

幫助反饋 APP下載

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

公眾號

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