Fabio
Fabio

Reputation: 141

Having issues with setTimeout() function

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 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?

Upvotes: 0

Views: 78

Answers (1)

Davis Z. Cabral
Davis Z. Cabral

Reputation: 514

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?

Upvotes: 1

Related Questions