我的HTML是這樣追加數據加載的問題
<div id="rsContainer">
<table id="rsTable"><!-- DATA HERE --></table>
</div>
,我的JavaScript是這樣
$('#UpdateAll').click(function() {
$('#status').fadeIn('500').text('Loading... This may take a while.');
$.ajax({
type: 'post',
url: 'func.php',
data: 'action=updateAll',
success: function(response) {
$('#response').fadeOut('500').fadeIn('500').append(response);
$('#rsTable').slideUp('1000').load('index.php #rsTable', function() {
$(this).appendTo('#rsContainer').slideDown('1000');
});
$('#status').fadeOut('500').empty();
}
});
});
這工作正常,但經過appening的HTML看起來像這樣
<div id="rsContainer">
<table id="rsTable">
<table id="rsTable"><!--data--></table>
</table>
</div>
正如你可以看到它實際上附加到rsTable我該如何維護原來的結構?
謝謝。
嘗試之前,其附加檢查響應值。它是否包含兩個rsTable表? – 2009-09-09 14:19:03