Timeago Jquery插件不起作用

Timeago Jquery plugin not working

本文关键字:不起作用 插件 Jquery Timeago      更新时间:2023-09-26

Jquery:

<script type="text/javascript" src="http://code.jquery.com/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);
}

#cmdzdiv 包含 abbr 标记。 timeago在加载中正常工作,但是当div刷新时,它将不起作用。

由于某种原因jQuery("abbr.timeago").timeago();该功能不起作用。在这里你可以找到完整的代码:在ajax调用jquery函数无法正常工作之后

试试Livestamp.js。它不显眼且自动更新。您只需要提供Unix时间戳。

工作演示 http://jsfiddle.net/FFeE3/1/

您能否尝试从以下链接中获取您的时间.js以及您使用的任何特定原因jQuery("abbr.timeago").timeago();您可以使用$("abbr.timeago").timeago();

希望这有助于休息演示应该给你更多的想法。 欢呼

脚本

  <script type='text/javascript' src="https://github.com/petersendidit/jquery-timeago/raw/master/jquery.timeago.js"></script>

法典

$("abbr.timeago").timeago();​

两种表示方式,以这种方式或其他方式做,但不要混合:-

jQuery(document).ready(function() {
  jQuery("abbr.timeago").timeago();
});

$(document).ready(function() {
  $("abbr.timeago").timeago();
});