...

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



devmostafa
12-23-2010, 10: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

Stooshie
12-23-2010, 11:07 AM
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.

devmostafa
12-23-2010, 11:32 AM
Dear Stooshie,

just making sure

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

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

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

Stooshie
01-05-2011, 04: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 0.0.0.1 > NUL



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum