View Full Version : adding timer to a single .js file

12-23-2010, 11:37 AM
Hi all,

i was trying to create a windows startup javascript where i was trying to perform a specific action after a time interval.

Could anybody please help me with the syntax to add this timer to my js file

thanks in advance

12-23-2010, 12:07 PM
To give you a hint, google for window.onload and setTimeout

Use the onLoad to call a function and in that function call a setTimeout.

12-23-2010, 12:32 PM
Dear Stooshie,

just making sure

does "window" works in a single startup .js file script

12-23-2010, 01:53 PM
It depends. At what point is your "startup" .js file being loaded?

12-23-2010, 01:55 PM
"startup" means that the script is loaded on windows startup

01-05-2011, 05:22 PM
Sorry, I misunderstood. I thought you meant the browser window.

You would be better to use a batch file in Windows. In which case you could use something like:

@ping -n 1 -w 1000 > NUL