aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Set Time Interval Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Set Time Interval" Watch "Set Time Interval" New topic
Author

Set Time Interval

naval kumar
Ranch Hand

Joined: Jul 08, 2012
Posts: 37
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

Joined: Jan 10, 2002
Posts: 61432
    
  67

Use setTimeout(), not setInterval(). read up on the differences between these two timer functions.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61432
    
  67

There's also no need to wrap the function(s) in anonymous functions:

naval kumar
Ranch Hand

Joined: Jul 08, 2012
Posts: 37
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

Joined: Nov 06, 2012
Posts: 297
    
    5

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.


Read my books: Hello! HTML5 & CSS3 | HTML5 in Action | Read my blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Set Time Interval