我有一个带有id="example"
的表。我还有一个按钮,可以在点击时重新加载表格。
<button id="refresh-btn">Refresh Table</button>
<script>
$(document).ready(function() {
function RefreshTable() {
$( "#example" ).load( document.URL + ' #example' );
}
$("#refresh-btn").on("click", RefreshTable);
</script>
单击按钮并重新加载后,表将刷新,但会丢失其CSS样式。 重新加载ajax之前:
重新加载ajax之后:
感谢您的帮助。