我有一个用Smarty编译的PHP模板。在这段代码中我已经嵌入DIV部分,与此类似:JQuery追加不工作?
<div>
<div id="services" style="margin-top: 5px; width: 100%; display:none;">
<div id='blocking' style="float: left; width: 100%;">
<div id="div1" ...>
</div>
<div id="div2" style="float: left; height:100px; width: 100%; margin-top: 4px; margin-bottom:4px;">
<table id="list" width="100%">
<thead>
<tr>
<th width="30%" class="tablaIzq">Lists</th>
<th width="70%" class="tablaIzq">Description</th>
</tr>
</thead>
<tbody id="LBBody">
</tbody>
</table>
</div>
</div>
</div>
</div>
使用AJAX + JSON称为一个WebService ES ...我希望把一些数据,我收到的TBODY LBBody但是当我尝试使用jquery的追加没有附加。
它的完成这样的:
$("#LBBody").append('<tr><td class="tablaIzq" style="font-weight: normal; height: 22;" colspan="3">Hi</td></tr>')
我使用追加错?
感谢和问候。
您是否在DOM就绪状态下调用append()? 即在$(function(){[...]});'? 否则当你调用append() – HBublitz