最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

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

Eclipse執(zhí)行不了JS里面的function函數(shù)

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

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

<title>Insert title here</title>

<script type="text/javascript">


function button1()?

{

var message1=confirm("please choose yes ro no?");

if(message1==true)

{

var message2=prompt("please enter your website","http://yifanck.cn/");

if(message2!=null)

{var message3=window.open('message2','width=400,height=500,menubar=no,toolbar=no')};

else

{document.write("bye1")};

}

else

{document.wriet("bye2!")};

}


</script>

</head>

<body>

<input type="button" value="打開(kāi)" onclick="button1()" />

</body>

</html>



Eclipse好像不能識(shí)別JS代碼,運(yùn)行web項(xiàng)目之后也執(zhí)行了Html語(yǔ)句,這個(gè)應(yīng)該怎么解決?


答:if-else函數(shù)里面;號(hào)放在{}后面


---------------------------------------------------------------------------------------------------

以下是能成功運(yùn)行的代碼,我也不知道哪里錯(cuò)了,但是輸入網(wǎng)址后點(diǎn)擊確定,404,而且第一個(gè)if的else語(yǔ)句執(zhí)行不了,點(diǎn)擊取消則無(wú)任何反應(yīng),若想執(zhí)行else應(yīng)該怎么寫(xiě)?(目前只想到alert彈窗)

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

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

<title>Insert title here</title>

<script type="text/javascript">


function button1()

{

var message1=confirm("please choose yes ro no?");

if(message1==true)

{

var message2=prompt("please enter your website","http://yifanck.cn/");

if(message2!=null)

{var message3=window.open('message2','width=400,height=500,menubar=no,toolbar=no');}

else

{document.write("bye1");}

}

else

{document.wriet("bye2!");}

}

</script>

</head>

<body>

<input type="button" value="打開(kāi)" onclick="button1()" />

</body>

</html>


正在回答

2 回答

Eclipse 不是Java軟件嗎?為什么不選適用Javascript的


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

HanaBin 提問(wèn)者

之前是因?yàn)镴S語(yǔ)句寫(xiě)錯(cuò)了,所以JS執(zhí)行不了;另外Eclipse沒(méi)有JS報(bào)錯(cuò)
2019-08-19 回復(fù) 有任何疑惑可以回復(fù)我~

沒(méi)人嗎?

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

舉報(bào)

0/150
提交
取消

Eclipse執(zhí)行不了JS里面的function函數(shù)

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

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

幫助反饋 APP下載

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

公眾號(hào)

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