Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Set Time Interval

 
naval kumar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sir,
I have to call 3 Function After Set a time Of Interval How can I call It. Like On The page Load I am calling and From This function onloadfun() i want to call these function After Specific Time Interval like After 6 seconds . But My Problem is that After Setting Time Interval in function. My Only One function is called again and again But reaming Two function is not calling.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64698
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use setTimeout(), not setInterval(). read up on the differences between these two timer functions.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64698
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's also no need to wrap the function(s) in anonymous functions:

 
naval kumar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its Againg Create problem I have One Function like and i want to call this function


from this function again and again
 
Rob Crowther
author
Ranch Hand
Posts: 297
5
Android Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to pass parameters, and you need it to work in IE, then do wrap the function(s) in anonymous functions. If you don't need to support iE, then put the parameters after the timeout:

There is a workaround to enable the standard behaviour in IE.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic