如何使用JavaScript或JQuery动态更改时间(这是纯文本)? [英] How can i dynamically change the time (which is plain text) using JavaScript or JQuery?
本文介绍了如何使用JavaScript或JQuery动态更改时间(这是纯文本)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
本网站,文字时间是动态更新的。我猜想使用javascript。
on this website the textual time is dynamically updated .. i'm guessing using javascript.
这是html代码,使用Firebug来检查页面...
this is the html code, using Firebug to inspect the page ...
<strong class="big" id="ct">Friday, 3 September 2010 at 8:17:21 AM</strong>
随着时间值逐渐增加。
我猜想一些javascript更新'ct'元素..但是我找不到代码怎么做?
I'm guessing some javascript updates the 'ct' element .. but I can't find the code to how that's done?
有人可以帮忙吗? p>
Can anyone help?
推荐答案
此页面上的JavaScript代码被模糊化,这可能是您找不到的原因。要实现这一点,您可以使用 setInterval
function:
The javascript code on this page is obfuscated and that't probably why you can't find it. To achieve this you could use the setInterval
function:
$(function() {
setInterval(function() {
$('#ct').html(new Date().toString());
}, 1000);
});
这篇关于如何使用JavaScript或JQuery动态更改时间(这是纯文本)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文