简体   繁体   English

ASP.NET Javascript Clock

[英]ASP.NET Javascript Clock

I would like to put a clock on my webpage which should show time and a timer for a particular interval. 我想在我的网页上放置一个时钟,该时钟应该显示特定时间间隔的时间和一个计时器。

Could you please suggest me some open source javascript to do that?? 你能建议我一些开源的JavaScript来做到这一点吗?

I tried unsuccessfully searching web for flash one's. 我尝试在网络上搜索Flash失败。

Please help. 请帮忙。

Thanks, Mahesh 谢谢,Mahesh

There is JavaScript function called SetInterval that allows you to pass a callback to be executed on a specified interval of time. 有一个名为SetInterval的JavaScript函数,该函数允许您传递在指定的时间间隔内执行的回调。 You can use it in order to repeat a given action over a period of time. 您可以使用它来在一段时间内重复执行给定的操作。 Here is an example: 这是一个例子:

 <script type="text/javascript">
    function doSomething() {
        alert('yahoo');
    }

    setInterval(doSomething, 500);

</script>

This will alert 'yahoo' оn every 500 miliseconds. 这将每500毫秒提醒一次“ yahoo”。

As for the clock, I suggest that you take a look at the following link 至于时钟,建议您看一下以下链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM