If images on the page take too long to load, then the “timeago” script (that converts absolute timestamps into relative ones, like “a month ago”) won’t run in a timely manner. This is because the timeago feature is only activated after everything on the page has loaded. The bug most often occurs when viewing threads where multiple people are using their Spartan renders as avatars; when the site is under heavy load, these can take ages to appear, jamming up the timeago feature.
I have seen this occur in Mozilla Firefox 18.0.2. It’s not a bug that can be reproduced on demand; you must view a thread where people are using Spartan avatars, while the servers are under enough load to cause the image to lag.
When you’re on the forum index, the SCRIPT tag that invokes the timeago functionality is the next sibling of DIV#halo_layout. Its contents are as follows:
//<![CDATA[
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(loadTimeAgo);
function loadTimeAgo() {
jQuery.timeago.settings.refreshMillis = 60000;
// english
jQuery.timeago.settings.strings = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: “ago”,
suffixFromNow: “from now”,
seconds: “less than a minute”,
minute: “a minute”,
minutes: “%d minutes”,
hour: “an hour”,
hours: “%d hours”,
day: “a day”,
days: “%d days”,
month: “a month”,
months: “%d months”,
year: “a year”,
years: “%d years”,
numbers:
};
jQuery(‘abbr.timeago’).timeago();
}//]]>
Basically, you guys are using ASP.NET’s JS library to hook a timeago call to the window’s onload event. Instead, you should probably hook it to jQuery’s ready event:
$.ready(
function() {
jQuery.timeago.settings.refreshMillis = 60000;
jQuery.timeago.settings.strings = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: “ago”,
suffixFromNow: “from now”,
seconds: “less than a minute”,
minute: “a minute”,
minutes: “%d minutes”,
hour: “an hour”,
hours: “%d hours”,
day: “a day”,
days: “%d days”,
month: “a month”,
months: “%d months”,
year: “a year”,
years: “%d years”,
numbers:
};
jQuery(‘abbr.timeago’).timeago();
}
);
Onload waits for all resources to load. DOMContentReady only waits for the DOM to be fully constructed.