Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Set Time Interval  RSS feed

 
naval kumar
Ranch Hand
Posts: 38
  • 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
Posts: 66141
141
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
Posts: 66141
141
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: 38
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!