Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    adding timer to a single .js file

    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

  • #2
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    380
    Thanks
    9
    Thanked 39 Times in 39 Posts
    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.
    Regards, Stooshie
    O

  • #3
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Dear Stooshie,

    just making sure

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

  • #4
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    380
    Thanks
    9
    Thanked 39 Times in 39 Posts
    It depends. At what point is your "startup" .js file being loaded?
    Regards, Stooshie
    O

  • #5
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    "startup" means that the script is loaded on windows startup

  • #6
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    380
    Thanks
    9
    Thanked 39 Times in 39 Posts
    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:
    Code:
    @ping -n 1 -w 1000 0.0.0.1 > NUL
    Regards, Stooshie
    O


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •