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

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

關(guān)于Javascript入門課程 第二章的練習(xí)題

<!DOCTYPE?html>
<html>
<head>
<meta?charset="UTF-8">
<title>編程練習(xí)</title>
<script?type?=?"text/Javascript">
//新窗口打開前彈出確認(rèn)框,是否打開
function?Openwindow(){
var?ifOpen?=?confirm(是否打開窗口?);
if(ifOpen?==?true){
	var?url?=?prompt("請(qǐng)輸入你要打開的網(wǎng)址","http://yifanck.cn")";
	window.open('url','_blank',
			????'width?=?400px,height?=?500px,menubar?:no,toolbar:no');
????}
????
}
</script>
</head>
<body>
<input?name?=?"button"?type?=?"button"?value?=?"新窗口打開網(wǎng)站"?onClick=?"Openwindow()">
</body>
</html>

執(zhí)行完,點(diǎn)擊“新窗口打開網(wǎng)頁”沒反應(yīng)呢?

正在回答

1 回答

修改代碼如下:有兩處有問題。1:第九行,內(nèi)容加引號(hào)。2.第11行,最后面多了個(gè)引號(hào)。粗心大意了。

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>編程練習(xí)</title>

<script type = "text/Javascript">

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

?var Openwindow = function (){

var ifOpen = confirm('是否打開窗口?');

if(ifOpen == true){

? ? var url = prompt("請(qǐng)輸入你要打開的網(wǎng)址","http://yifanck.cn");

? ? window.open('url','_blank',

? ? ? ? ? ? ? ? 'width = 400px,height = 500px,menubar :no,toolbar:no');

? ? }

}

</script>

</head>

<body>

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

</body>

</html>


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

shaoxiao64017599 提問者

對(duì)哈 謝謝啦
2017-01-06 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

關(guān)于Javascript入門課程 第二章的練習(xí)題

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

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

幫助反饋 APP下載

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

公眾號(hào)

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