开发者

Having issues with setTimeout() function

开发者 https://www.devze.com 2023-03-30 20:06 出处:网络
I\'m using the tabs feature from jQuery UI and I need to reload the tab after 5 seconds. I currently have two methods of reloading the data:

I'm using the tabs feature from jQuery UI and I need to reload the tab after 5 seconds. I currently have two methods of reloading the data:

  1. Automatic (jQuery/JavaScript)
  2. Click link

When reloading the first time automatically and after clicking the reload link, the reload is not following the desired time of 5 seconds.

Example:

  1. Enter the page - Call method for automatic reload (ok开发者_JS百科 working)
  2. Pass 3 seconds - Click link for reload manual (ok working)
  3. Time is obeying the 5 second timeframe.

What options do I have?


It's hard to say without looking the code, but it seems that you need cancel the first setTimeout call before call it again using the manual action.

Can you show the code?

0

精彩评论

暂无评论...
验证码 换一张
取 消