how to schedule ajax calls every N seconds?

前端 未结 4 1488
天命终不由人
天命终不由人 2020-12-02 02:17

If I want a whole page to reload every N seconds, I would put something like this in the HTML: meta http-equiv=\"refresh\" content=\"5\"

Is there a sta

4条回答
  •  情歌与酒
    2020-12-02 02:38

    function proxy()
    {
      /* implement call to your Ajax method */
    }
    
    setInterval( proxy, 1000 ); // last arg is in milliseconds
    

提交回复
热议问题