在我的页面上,我以异步方式加载表格内容:
$.post( "test.php", function( data ) {
$('#myTableBody').html(data);
//refresh the content by jQuery
});
进入以下表体:
<table>
<thead>
...
</thead>
<tbody id='myTableBody'>
<!--No Content before loading it -->
</tbody>
</table>
test.php
包含正常表格格式的表格主体内容,例如 <tr><td></td></tr>
,与 jQuery
- 和Twitter-Bootstrap
- 弹出窗口或对话框的标签。 (这些标签的代码不是必需的,因为我认为应该有一种方法可以通过一个通用标签刷新 jQuery?)
在静态页面上加载那些 jQuery
-标签被替换为 css
和html
-当 device-ready
时由 jQuery 定义的标签事件出现。
但现在我的问题是,怎么说jQuery/ js/ twitter-bootstrap
,有新内容。如何触发重新替换?
最佳答案
使用ready() ,所以 DOM 已经准备好进行操作了,
jQuery(function($){
$.post( "test.php", function( data ) {
$('#myTableBody').html(data);
//refresh the content by jQuery
});
});
关于javascript - jquery 标签不是由 $.post 生成的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22144396/