//更新信息函数,每隔一定时间去服务端读取数据 |
function updateMsg() { |
$.post( "backend.php" , { |
time : timestamp |
}, function (xml) { |
//移除掉 等待提示 |
$( "#loading" ).remove(); |
//调用解析xml的函数 |
addMessages(xml); |
}); |
//每隔4秒,读取一次. |
setTimeout( 'updateMsg()' , 4000); |
} |