Results 1 to 3 of 3

Thread: Timer with Javascript

  1. #1
    Join Date
    May 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Timer with Javascript

    Hello !

    I have one little problem in one of my application.
    I start a timer as I run a background work but the second time I start the background thing, the timer doesn't start.

    Code:
    function RunBackgroundTask() {
      var mytimer = setTimeout("UpdateTimer()", 500);
      LaunchAjaxthing();
    }
    
    function UpdateTimer() {
      pct = oCIA.CIAReadData(sID,"PCT");
      if(pct!="-1") { 
    	setTimeout("UpdateTimer()", 500);
    	report.innerHTML="'" + pct + "'";
      }	
    }
    I didn't put all the details of RunBackgroundTask but if needed I will.

    Thanks for the help !

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    An URL to your page would be more helpful.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    May 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    it's not public I'm afraid. I work on intranet applications

    Nevermind... I figured it out.. I was reading my data before I even initialized (CIAReadData) it back to 0 the second time so it was stopping as soon as it started...
    Ahhh... shame on me
    Last edited by Narfix; 06-19-2006 at 03:46 PM.

Bookmarks

Posting Permissions

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