471,881 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,881 software developers and data experts.

Need to redisplay a portion of the window, without using refresh

I have a need to constantly update a portion of the screen - containing the results of a calculation; and the calculation includes elased time - so constantly changes (increases) the result). Ideally refreshing every 1 or 2 secs.

I tried a permanent WHILE loop, but I get an error that the script is slowing the browser.

Can anyone:
- tell we which way to go,
- or give pros/cons of techniques,
- or point me to anything similar

I decided not to constantly 'refresh' the page, because the progress bar (whatever it's called?) at the bottom of the browser window is disruptive to the eye. Even refreshing a frame within a window, causes this bar to flash - or does anyone know a way to disable this?

Sep 17 '07 #1
1 1406
1,208 Expert 1GB
I would do something like this
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. start = 0; //start number
  3. window.setInterval("testfunction()", 1000); // 1000 = 1 second
  4. function testfunction() {
  5.  start++;
  6.  document.getElementById("nval") .value = start;
  7. }
  8. </script>
  9. <input type="text" id="nval" value="0">
Sep 17 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

24 posts views Thread by Andy Sutorius | last post: by
14 posts views Thread by D. Alvarado | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.