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

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

第二章最后的練習(xí)題卡住了,不知道代碼哪里有問題,希望大家指正

第二章最后的練習(xí)題卡住了,不知道代碼哪里有問題,希望大家指正

leonailele 2016-11-04 05:27:14
<!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 mess=confirm("是否打開網(wǎng)頁(yè)");? ? ? ? ? ? ? if(mess==true)? ? ? ? ? ? ? {? ? ? ? ? ? ? ? prompt("輸入網(wǎng)站","http://idcbgp.cn");? ? ? ? ? ? ? }? ? ? ? ? ? ? var openshit=prompt? ? ? ? ? ? ? ? if(openshit!=null)? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? window.open('openshit','height=500,width=400,menubar=no,toolbar=no')? ? ? ? ? ? ? ? }? ? ? ? ? ? ? ? else? ? ? ? ? ? ? ? {alert("badnews")}? ? ? ? ? ? ? else{alert("badnews")? ? ? ? ? ? ? }? ??? ??? </script>??</head>??<body>? ?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />??</body></html>
查看完整描述

1 回答

已采納
?
千秋此意

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

function?openWindow()?{
????var?mess,?openshit;
????mess?=?confirm("是否打開網(wǎng)頁(yè)");
????if?(mess?==?true)?{
????????openshit?=?prompt("輸入網(wǎng)站",?"http://idcbgp.cn");
????????if?(openshit?!=?null)?{
????????????window.open(openshit,?'height=500,width=400,menubar=no,toolbar=no')
????????}?else?{
????????????alert("badnews")
????????}
????}?else?{
????????alert("badnews")
????}
}

都是些奇怪的錯(cuò)誤。。。平時(shí)養(yǎng)成好習(xí)慣吧,一定要注意縮進(jìn)!

查看完整回答
反對(duì) 回復(fù) 2016-11-04
  • leonailele
    leonailele
    請(qǐng)問原語(yǔ)句有什么問題呢 句法上有什么錯(cuò)誤呢
  • 千秋此意
    千秋此意
    1、function openWindow(); 多了分號(hào),(寫js不要用 “{” 另起一行的寫法)。 2、if else語(yǔ)句錯(cuò)誤(而且第二個(gè)else那里還少個(gè)大括號(hào),縮進(jìn)嚴(yán)格的話是不可能出現(xiàn)這種錯(cuò)誤的)。 3、var openshit=prompt, prompt是一個(gè)函數(shù),prompt("輸入網(wǎng)站", "http://idcbgp.cn")這一句才是調(diào)用prompt這個(gè)函數(shù),返回值才是你想要的url。 3、window.open('openshit'...)這里第一個(gè)參數(shù)你加了引號(hào),相當(dāng)于去打開一個(gè)當(dāng)前路徑下文件名叫openshit的文件,你的本意應(yīng)該是引用變量,所以不要加引號(hào)
  • 1 回答
  • 0 關(guān)注
  • 1359 瀏覽
慕課專欄
更多

添加回答

舉報(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)