How to Ajax auto refresh after x seconds
2010-12-30 17:24
288 查看
Use of setInterval function
just alert “hello San” to test this functionsetInterval("alert('Hello San')"
,
5000
)
;
///////// 5 seconds
Example: just alert “hello San” to test this function after 10 seconds
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script><script language="JavaScript">setInterval( "alert('Hello San')", 10000 );</script>User it for call your main function.
setInterval( "SANAjax();" , 10000 ) ; ///////// 10 seconds
Example : With jquery,update div contents after 5 seconds
<
script type=
"text/javascript"
src=
"http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"
></
script><
script language=
"JavaScript"
>setInterval(
"SANAjax();"
,
5000
)
;
///////// 10 seconds$(
function
(
)
{SANAjax =
function
(
)
{$(
'#dataDisplay'
)
.prepend
(
"Hi This is auto refresh example for you - w3cgallery.com <br><br>"
)
.fadeIn
(
"slow"
)
;}}
)
;</
script>
相关文章推荐
- AX2012 How to refresh a form after some operate (Method 1)
- how to auto refresh your web page in browser?
- How to auto start XEN VMs after reboot of DOM 0
- How to run an ajax call after another ajax call?
- How to auto start XEN VMs after reboot of DOM 0
- How to close (auto hide) WPF window after 10 sec using a timer in C#?
- How to auto start XEN VMs after reboot of DOM 0
- How to fix intellisense issues after upgrading to ASP.NET Ajax 1.0 RC
- How to fix intellisense issues after upgrading to ASP.NET Ajax 1.0 RC
- How to fix intellisense issues after upgrading to ASP.NET Ajax 1.0 RC
- [ASP.NET AJAX]How to register javascript functions after UpdatePanel updated
- How to implement Android Pull-to-Refresh
- How to serve AJAX pages (Ember.js, Angular, etc) to Google's dummy bots?
- How To Disable Automatic Restart after Windows Update
- How to release IPC resource after oracle Instance crash/abort
- Custom checkout cart – How to send email after successful checkout
- STM8L Power Saving : How to Implement Auto Wake-Up Mode in STM8L101xx
- How to update the Microsoft Dynamics CRM Web site port after you install Microsoft Dynamics CRM 4.0
- How to restore data after linux can't boot
- Android PullToRefreshScrollView、AutoHeightListView、AutoScrollViewPager的使用