Right now I have a date value like so:
2011-04-29T07:08:22.000Z
I want开发者_运维技巧 to turn this in to a live updating (no page refresh) elapsed time representation.
What is the most efficient way to do this?
Use jquery timeago, it's really good and easy.
You just do something like this for initialization :
jQuery(document).ready(function() {
jQuery("abbr.timeago").timeago();
});
And like this everywhere you want some time to be displayed :
<abbr class="timeago" title="2008-07-17T09:24:17Z">July 17, 2008</abbr>
精彩评论