Jquery:
<script type="text/javascript" src=".7.2.min.js"></script>
<script type="text/javascript" src="js/timeago.js" ></script>
$(document).ready(function(){
jQuery("abbr.timeago").timeago();
});
html:
<abbr class="timeago" title="2008-07-17T09:24:17Z">July 17, 2008</abbr>
function Refresh() {
setTimeout(function(){
<?php echo 'var id = '.json_encode($_GET['id']).';'; ?>
$('#cmdz').load('cmdajax.php?id='+id);
},1000);
}
The #cmdz
div contains the abbr
tag. timeago working properly in onload but when the div is refreshed it won't works.
for some reason jQuery("abbr.timeago").timeago();
function not working. Here you can find full code:after ajax call jquery function not working properly
Jquery:
<script type="text/javascript" src="http://code.jquery./jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/timeago.js" ></script>
$(document).ready(function(){
jQuery("abbr.timeago").timeago();
});
html:
<abbr class="timeago" title="2008-07-17T09:24:17Z">July 17, 2008</abbr>
function Refresh() {
setTimeout(function(){
<?php echo 'var id = '.json_encode($_GET['id']).';'; ?>
$('#cmdz').load('cmdajax.php?id='+id);
},1000);
}
The #cmdz
div contains the abbr
tag. timeago working properly in onload but when the div is refreshed it won't works.
for some reason jQuery("abbr.timeago").timeago();
function not working. Here you can find full code:after ajax call jquery function not working properly
- link to jquery plug in : link – sudeep cv Commented Jun 19, 2012 at 11:25
3 Answers
Reset to default 4Try out Livestamp.js. It's unobtrusive and auto-updating. All you need to provide is the Unix timestamp.
Working demo http://jsfiddle/FFeE3/1/
Can you please try sourcing your time ago.js from below link and any particular reason you are using jQuery("abbr.timeago").timeago();
you can use $("abbr.timeago").timeago();
Hope this helps rest demo should give you more idea. cheers
Script
<script type='text/javascript' src="https://github./petersendidit/jquery-timeago/raw/master/jquery.timeago.js"></script>
code
$("abbr.timeago").timeago();
Two way of representation, Do this way or other way but don't mix:-
jQuery(document).ready(function() {
jQuery("abbr.timeago").timeago();
});
OR
$(document).ready(function() {
$("abbr.timeago").timeago();
});