469,322 Members | 1,157 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,322 developers. It's quick & easy.

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

31
Hi
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?

Thanks
Sep 17 '07 #1
1 1383
iam_clint
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">
  10.  
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.