最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Timeago Jquery plugin not working - Stack Overflow

programmeradmin0浏览0评论

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

Share Improve this question edited May 23, 2017 at 12:06 CommunityBot 11 silver badge asked Jun 19, 2012 at 11:22 sudeep cvsudeep cv 1,0277 gold badges20 silver badges34 bronze badges 1
  • link to jquery plug in : link – sudeep cv Commented Jun 19, 2012 at 11:25
Add a ment  | 

3 Answers 3

Reset to default 4

Try 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();
});
发布评论

评论列表(0)

  1. 暂无评论