Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Tips

Markus Walz edited this page · 6 revisions
Clone this wiki locally

This is how I implement timeago in my js code:

function activate_timeago()
{
    $('.timeago').each(function()
    {
        var $this = $(this);
        if ($this.data('active')!='yes')
            {
                $this.timeago().data('active','yes');
            }
    });
    setTimeout(activate_timeago, 60000);
}

This iterates through every element with the timeago class and checks if it has timeago activated, if it doesn't it activates it. This check ensures that it is not activated multiple times on the same element which can slow things down.

Something went wrong with that request. Please try again.