www.webdeveloper.com
Results 1 to 2 of 2

Thread: setTimeout not working when run remotely

  1. #1
    Join Date
    Feb 2009
    Posts
    1

    setTimeout not working when run remotely

    Below is part of a script that I am trying to deploy via SCCM Software Distribution. The script notifies the user that they need to restart their machine. If the user opens another window, hiding the notification, the notification is supposed to reappear in front of all other windows every 10 minutes. This function works properly when testing on my machine.

    When running the script from a remote system, the timeout feature does not work. It also doesn't work if I copy the file to another machine and run. Can someone tell me how to edit the script so the timeout method works when running remotely?

    Code:
    <script language="JavaScript">   
    var timeoutId;   
    function setReminder() {   
       timeoutId = window.setTimeout("window.focus()", 10*60*1000);   
    }   
    function cancelReminder() {   
       if (timeoutId>0) {   
         window.clearTimeout(timeoutId);   
       }   
    }   
    // set the window to come back in focus    
    window.onblur = setReminder;   
    // reset the timeout if the window comes back in focus    
    window.onfocus = cancelReminder;   
    </script>
    Thank you!

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    javascript can not run "remotely", because javascript can not pass the cross-domain borders.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles