$(document).ready(function(){
var refreshId = setInterval(function() {
periodicRefresh();
}, 9000);
})
function periodicRefresh()
{
$.ajax({
type: 'GET',
url: 'include/ajaxActions.php',
data: "action=displayLastEvent",
success: function(msg){
var newid = $(msg).attr("id");
current = $("#list tr:first").get(0).id;
if(newid != currentfirstrow){
$("#list").prepend(msg);
lastrow = current-19;
$('#'+lastrow).remove();
}
}
});
}
這裏是什麼樣的表格行看起來像一個例子:
<tr id="5094" style="background:White;">
<td class="tdstd">
</td>
</tr>
ajaxActions.php的輸出僅是:
但我也可以將它格式化爲XML – Roch 2009-10-17 20:58:25
好的,所以你只是在輸出html。很高興知道,讓我考慮一下。 – WesleyJohnson 2009-10-17 21:20:56