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

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

最下面js語句中,為什么設(shè)置keyboard屬性時(shí)后面不能加分號(hào)?

<!DOCTYPE?html>
<html>
<head>
<meta?charset="utf-8">
<title>JavaScript觸發(fā)時(shí)的參數(shù)設(shè)置(二)</title>
<link?rel="stylesheet"?>
</head>
<body>
<button?class="btn?btn-primary"?type="button">點(diǎn)擊我</button>
<div?class="modal"?id="mymodal"?tabindex="-1">
<!--下面是彈框內(nèi)容-->
????<div?class="modal-dialog">
????	<div?class="modal-content">
			<div?class="modal-header">
				<button?type="button"?class="close"?data-dismiss="modal"><span?aria-hidden="true">&times;</span><span?class="sr-only">Close</span></button>
				<h4?class="modal-title">模態(tài)彈出窗標(biāo)題</h4>
			</div>
			<div?class="modal-body">
				<p>模態(tài)彈出窗主體內(nèi)容</p>
			</div>
			<div?class="modal-footer">
				<button?type="button"?class="btn?btn-default"?data-dismiss="modal">關(guān)閉</button>
				<button?type="button"?class="btn?btn-primary">保存</button>
			</div>
		</div><!--?/.modal-content?-->
	</div><!--?/.modal-dialog?-->
</div><!--?/.modal?-->

<script?src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<script?src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>?
<script>
??$(function(){
????$(".btn").click(function(){
??????$("#mymodal").modal({
????????//???為什么這里不能加分號(hào)呢?
??????????keyboard:false
??????});
????});
??});
</script>
</body>
</html>


正在回答

3 回答

根據(jù)語法規(guī)則,一般分號(hào)在函數(shù)主體中起一段語句的分隔作用,比如$(".btn").click(function(){}這段代碼中大括號(hào)內(nèi)就是指函數(shù)主體,分隔一般用分號(hào),而$("#mymodal").modal({? ?keyboard:false? ?})中包括大括號(hào)都是參數(shù),一般用逗號(hào)分隔。


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

nostic 提問者

非常感謝!
2016-04-17 回復(fù) 有任何疑惑可以回復(fù)我~

這是對(duì)象,對(duì)象是用逗號(hào)分隔的

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

這是個(gè)json,{key1:value1, key2:value2,...}; 括號(hào)里面當(dāng)然不能加分號(hào)了

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

舉報(bào)

0/150
提交
取消

最下面js語句中,為什么設(shè)置keyboard屬性時(shí)后面不能加分號(hào)?

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

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

幫助反饋 APP下載

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

公眾號(hào)

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