【发布时间】:2011-08-21 09:12:04
【问题描述】:
我正在使用这个插件https://github.com/rmm5t/jquery-timeago/blob/master/jquery.timeago.js
当我将新内容加载到 Dom 时,时间戳的自动刷新(以前的内容)停止工作(使用新加载的内容,工作正常)...
我尝试在 document.ready 上使用 Livequery 的修改版本,但也没有用..
加载新内容的函数是:
function reload_timeline(filter, more, update) {
if (update) {
$("#new_updates").hide();
}
beforeTimelineLoad(more, update);
$.post("/ajax/timeline_box_" + timeline_type + ".php", {
filter: filter,
timeline_type: timeline_type,
timeline_user_id: timeline_user_id,
smaller_id: timeline_smaller_id,
bigger_id: timeline_bigger_id,
start: timeline_start,
more: more,
update: update
}, function (data) {
if (data.length > 0 && timeline_type == "home") $("#pilltabs").show();
afterTimelineLoad(data, more, update, filter);
});
}
我尝试做类似的事情
$("abbr.timeago", data).timeago();
在“afterTimelineLoad”函数中,将 timeago() 函数仅应用于数据中的新 abbr.timeago,但也不起作用...
我真的不知道该尝试什么...有什么线索吗?
【问题讨论】: