Results 1 to 3 of 3

Thread: Get javascript timer status?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    27

    Question Get javascript timer status?

    Hello!
    Well, this is though one...
    I have to display the progress of a javascript timer on a label on my vb.net program. Im really lost on this one.

    Heres the javascript timer code:

    Code:
    function update_timer() {
    			now = new Date();
    			pause_time = ( stop_time - now.getTime() ) / 1000;
    			if ( pause_time > 0 ) {
    				timer_id = setTimeout( 'update_timer()', 1000 );
    				document.getElementById( 'pause_countdown' ).innerHTML = Math.ceil( pause_time ).toFixed( 0 );
    			} else {
    				document.getElementById( 'pause_info' ).innerHTML = 'Process Complete';
    			}
    		}
    
    		pause_time   = 20 * 1000;
    		now          = new Date();
    		stop_time    = now.getTime() + pause_time;
    Code:
    <span id="pause_info" style="font-size:12px;font-weight:bold;"><span id="pause_countdown">20</span> For Complete </span>
    Code:
    <script type="text/javascript" language="javascript">
    	<!--
    		timer_id   = setTimeout( 'update_timer()', 1000 );
    	// -->
    	</script>
    Well i dont know javascript, but it looks very similar to what vb.net is...

    The problem is how i get the current value of the timer?

    Thanks in advance,
    JCC

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    27

    Re: Get javascript timer status?

    Maybe this helps, but i dont know how to implement it for my needs.

    http://www.experts-exchange.com/Prog..._20941171.html

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Posts
    27

    Re: Get javascript timer status?

    I found that maybe using the ObjectForScripting property may do the job, but i dont really get how to use it.
    Can someone help me?

    Thanks in advance,
    JCC

Posting Permissions

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



Click Here to Expand Forum to Full Width