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

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

代碼寫出來了但顯示不了效果,不知道哪出問題了?求指點(diǎn):

<!DOCTYPE html>

<html>

?<head>

? <title> new document </title>??

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

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

? ? function openWidow(){

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

? ? ? ? var input=confirm("確認(rèn)打開?");

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

? ? ? ? if(input==ture){

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

? ? ? ? ? ? window.open('http://idcbgp.cn/','_blank','menubar=no,scrollbars=yes,toolbar=no,status=no')

? ? ? ? }else

? ? ? ? {? ?alert("null");

? ? ? ? ? ? }?

? ? ? ? openWidow();

? ? }

? </script>?

?</head>?

?<body>?

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

?</body>

</html>


正在回答

4 回答

<script?type="text/javascript">
????//?新窗口打開時彈出確認(rèn)框,是否打開
????var?crel?=?confirm("Open?a?new?window??");
????if(crel?==?true){
????????//?通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為?http://idcbgp.cn
????????var?prel?=?prompt("Input?url:",?"http://idcbgp.cn");
????????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
????????window.open(prel,?"_blank",?"width=400,height=500,menubar=no,toolbar=no");
????}????????
</script>

給你參考一下。

你代碼的問題:

1、少了一個輸入框 prompt。

2、window.open 語句后面沒有分號,

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

慕尼黑506139 提問者

window.open()后面可以不加分號會影響效果嗎?
2018-09-24 回復(fù) 有任何疑惑可以回復(fù)我~
#2

慕尼黑506139 提問者

謝謝?
2018-09-24 回復(fù) 有任何疑惑可以回復(fù)我~
#3

simple自在 回復(fù) 慕尼黑506139 提問者

為了規(guī)范和嚴(yán)謹(jǐn),還是加上吧。不加我也不知道會有什么結(jié)果。
2018-09-24 回復(fù) 有任何疑惑可以回復(fù)我~
#4

simple自在 回復(fù) 慕尼黑506139 提問者

哦,這樣啊。行吧,剛學(xué)習(xí),能正確運(yùn)行就行,更深入的現(xiàn)在還沒有能力探討
2018-09-24 回復(fù) 有任何疑惑可以回復(fù)我~
#5

慕尼黑506139 提問者

按你的源代碼打了一下還是顯示不出來,按按鈕沒有任何效果
2018-09-24 回復(fù) 有任何疑惑可以回復(fù)我~
#6

慕尼黑506139 提問者

回復(fù) simple自在 還是沒法運(yùn)行,不知道哪出問題了
2018-09-24 回復(fù) 有任何疑惑可以回復(fù)我~
查看5條回復(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 dakai=confirm("打開窗口嗎?");

? ? if(dakai==true)

? ? {

? ? ? ??

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

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

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

? ? ? ? }

? ? ? ? else

? ? ? ? {

? ? ? ? ? ? alert("謝謝使用!")

? ? ? ? }

? ? ? ?

? ? }

? ? else{

? ? ? ? document.write("前端很好,你要學(xué)習(xí)哦!")

? ? }

? }

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


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


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

? ??

? ??

? </script>?

?</head>?

?<body>?

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

?</body>

</html>


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

慕尼黑506139 提問者

widow.open()中_blank前面可以省略嗎
2018-09-26 回復(fù) 有任何疑惑可以回復(fù)我~

function openWidow(){

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

? ? ? ? var input=confirm("Open a new window?");

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

? ? ? ? if(input==true){

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

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

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

? ? ? ? ? ? }else{alert("null");

? ? ? ? }

? ? }

問題找到了,input==true錯寫成input==ture;

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

function openWidow(){

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

? ? ? ? var input=confirm("Open a new window?");

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

? ? ? ? if(input==ture){

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

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

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

? ? ? ? ? ? }else{alert("null");

? ? ? ? }

? ? }

<--打出如上代碼頁面還是打不開,是網(wǎng)址問題嗎?-->

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

慕尼黑506139 提問者 回復(fù) simple自在

我弄了半天,發(fā)現(xiàn)加了;也不執(zhí)行,后來復(fù)制代碼慢慢往回改又執(zhí)行了。頭疼,兩個代碼幾乎一模一樣,就一個僅能顯示。現(xiàn)在效果出來了,就是還是搞不清楚兩個代碼一模一樣為什么顯示不出同樣的效果。
2018-09-24 回復(fù) 有任何疑惑可以回復(fù)我~
#2

慕尼黑506139 提問者 回復(fù) simple自在

不過還是謝謝你
2018-09-24 回復(fù) 有任何疑惑可以回復(fù)我~
#3

qq_舊巷少年_cfmpFS 回復(fù) 慕尼黑506139 提問者

::::::::::::::::::這個的問題,提示的他寫的是中文的
2018-09-26 回復(fù) 有任何疑惑可以回復(fù)我~
#4

慕尼黑506139 提問者

input==true
2018-09-26 回復(fù) 有任何疑惑可以回復(fù)我~
#5

慕尼黑506139 提問者 回復(fù) qq_舊巷少年_cfmpFS

代碼true錯寫成了ture
2018-09-26 回復(fù) 有任何疑惑可以回復(fù)我~
查看3條回復(fù)

舉報

0/150
提交
取消

代碼寫出來了但顯示不了效果,不知道哪出問題了?求指點(diǎn):

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

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

幫助反饋 APP下載

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

公眾號

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