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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

學(xué)習(xí)JAVAscript 遇到的問題 2-7編程練習(xí)

學(xué)習(xí)JAVAscript 遇到的問題 2-7編程練習(xí)

杰猛人 2015-04-18 17:46:18
<!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 chuang=confirm("您要打開一個(gè)新的窗口嗎?");? ? ? ? // 新窗口打開時(shí)彈出確認(rèn)框,是否打開? ? ? ? var website;? ? ? ??? ? ? ? if(chuang==true)? ? ? ? { website=prompt("請(qǐng)確認(rèn)要訪問的網(wǎng)址并確認(rèn)"?? ? ? ? ?,"http://idcbgp.cn" );? ? ??? ? ? ? }? ? ? ? ?else{}? ? ? ? if(website!=null)? ? ? ? {? ? ? ? window.open("website","_blank","width=100? ? ? ? ,height=500,menubar=no,toolbar=no")? ? ? ? }? ??? ? ? ?? ??? } ? ?? </script>??</head>??<body>? ?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />??</body></html>
查看完整描述

1 回答

?
Perona

TA貢獻(xiàn)355條經(jīng)驗(yàn) 獲得超403個(gè)贊

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

這里變量名是不需要加引號(hào)的。

代碼中if語(yǔ)言沒有正確嵌套。

修改后的代碼

<!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?chuang?=?confirm("您要打開一個(gè)新的窗口嗎?");
????????????//?新窗口打開時(shí)彈出確認(rèn)框,是否打開
????????????var?website;
????????????if?(chuang?==?true)?{
????????????????website?=?prompt("請(qǐng)確認(rèn)要訪問的網(wǎng)址并確認(rèn)",?"http://idcbgp.cn");
????????????????if?(website?!=?null)?{
????????????????????window.open(website,?"_blank",?"width=100,height=500,menubar=no,toolbar=no")
????????????????}
????????????}else?{
????????????}
????????}
????</script>
</head>
<body>
<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"/>
</body>
</html>


查看完整回答
反對(duì) 回復(fù) 2016-01-15
  • 1 回答
  • 0 關(guān)注
  • 1528 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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