Jquery 中 html+= ...是什么意思?

最近在看Jquery,遇到一个问题就是出现html+= ...;这个html+=不就是等价于html=html+... 么?

具体见如下代码:
<script type="text/javascript">
$(document).ready(function(){
$('#bu').click(function(){
var data;//定义data变量存储json文件的结果
$.getJSON("b.json",data,function(data){
alert("fff");
$("#hw").empty();//清空hw div的内容
$.each(data,function(entryIndex,entry){
var html='<div class="entry">';
html+='<h3 class="term">'+entry['term']+'</h3>';
html+='<div class="part">'+entry['part']+'</div>';
html+='<div class="definition">';
html+=entry['definition'];
html+='</div>';
//遍历每个大括号里的记录
if(entry['quote']){//判断是quote数组记录用each遍历
html+='<div class="quote">';
$.each(entry['quote'],function(index,line){
html+='<div class="quote-line">'+line+'</div>';
});
if(entry['author']){//判断author记录,如果在if外加会使得到的结果放在后面
html+='<div class="quote-author">'+entry['author']+'</div>';
}
}

html+='</div>'
$('#hw').append(html);
});
});
});
});

</script>
请问这个该怎么解释?谢谢大家了。
+=基本弄清楚了。那还有就是 html.= 呢?这个是什么意思呢?比如:

$html = '<div class="entry">';
$html .= '<h3 class="term">';
$html .= $term;
$html .= '</h3>';
$html .= '</div>';
print($html);
请教一下这个 .= 怎么解释?谢谢了。

html+=。。。。。

意思就是 在htnl后面添加数据~

比如这样!html等于123 html+=这里来一ABC

那么现在显示的结果就是 123ABC

就是在连着html后面显示
温馨提示:内容为网友见解,仅供参考
第1个回答  2010-07-15
楼上正解,就是写了一些html语句,加在了id为hw的后面

大哥,你有点过分呢!查了好多资料,没有.=这个东西,后来实验也不行,我很肯定的告诉你:那个肯定是-=,你认真对比一下,这个.=后面的东西不是前面+=
上去的嘛!!!
第2个回答  2019-03-04
都是字符串的拼接 +=是js .=是php的 .是php的连接符 +是js的连接符
第3个回答  2010-07-15
楼主这里html+=有什么问题吗?
就是字符串连接,
第4个回答  2010-07-15
html+="其他";
==>
html=html+"其他"
相似回答