Is it possible to refresh partial frequently using Ajax?

前端 未结 3 1018
旧时难觅i
旧时难觅i 2020-12-01 08:27

In background, I want it to reload and shows the number how many unread messages are there.
I want that without refreshing page. I mean using ajax.

If I had t

3条回答
  •  不知归路
    2020-12-01 09:12

    Yes you can

    
    
    
    
    
    

    This page will refresh every 5 seconds. This is because we're using the 'onload' event to call our function. We are passing in the value '5000', which equals 5 seconds.

    But hey, try not to annoy your users too much with unnecessary page refreshes every few seconds!

    Source: http://www.quackit.com/javascript/javascript_refresh_page.cfm

提交回复
热议问题