jquery-timeago
jquery-timeago copied to clipboard
A way to 'reset' plugin timer
Hello,
Not sure if this is a bug or a feature ;) - I have a <time>
tag that is updated using ajax but tag text is not getting unpdated using datetime
attribute value.
Is there a way to reset plugin timer ? Or get inWords
text to updated tag manually ?
+1
+1
Looking at the source, it looked like this could be done via $(el).timeago('action') using an action of 'updateFromDOM'.
I am also updating an abbr's title attribute on success of an ajax call, and then doing this after that: $("abbr.timeago").timeago('updateFromDOM');
This achieved resetting the timer based on the updated title value. Hope that helps.
@mmccaff's suggestion worked for me. Thanks!