是否有任何类似 twitter 的解决方案可以使用 PHP 实时检索新的 mysql 记录并让它们向下滑动
谢谢,
最佳答案
这样试试
$(function() {
setInterval(function() {
$.ajax({
type: "GET",
url: "location/of/server/script.php",
success: function(html) {
// html is a string of all output of the server script.
$("#element").html(html);
}
});
}, 5000);
});
每 5 秒更新一次。
这只是一个示例脚本,成功后可以添加淡入淡出效果。希望对您有所帮助
关于php - jquery AJAX实时获取新的mysql记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10534870/