doucang8303 2011-09-05 14:42
浏览 113

JQuery追加不起作用?

I have a PHP template that is compiled with Smarty. In this code I have embedded div sections, similar to this:

 <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> 

A webservice es called using ajax+json... and I would like to put some of the data that I receive in the tbody LBBody but when I try using jquery's append nothing is appended.

It's done like this:

$("#LBBody").append('<tr><td class="tablaIzq" style="font-weight: normal; height: 22;" colspan="3">Hi</td></tr>')

Am I using append wrongly?

Thanks and best regards.

  • 写回答

4条回答 默认 最新

  • dongmeng0317 2011-09-05 14:43
    关注

    Be sure you put your append code AFTER your actual elements. Otherwise it won't work

    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题