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

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

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

學(xué)習(xí)JAVAscript 遇到的問(wèn)題 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("您要打開(kāi)一個(gè)新的窗口嗎?");? ? ? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)? ? ? ? var website;? ? ? ??? ? ? ? if(chuang==true)? ? ? ? { website=prompt("請(qǐng)確認(rèn)要訪(fǎng)問(wèn)的網(wǎng)址并確認(rèn)"?? ? ? ? ?,"http://yifanck.cn" );? ? ??? ? ? ? }? ? ? ? ?else{}? ? ? ? if(website!=null)? ? ? ? {? ? ? ? window.open("website","_blank","width=100? ? ? ? ,height=500,menubar=no,toolbar=no")? ? ? ? }? ??? ? ? ?? ??? } ? ?? </script>??</head>??<body>? ?<input type="button" value="新窗口打開(kāi)網(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ǔ)言沒(méi)有正確嵌套。

修改后的代碼

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


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

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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