SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : Dynamic HTML :

Previous DiscussionNext Discussion
 IE memory leaks

The following script locks IE, ha de ha ha. I have read alot about memory leaks and they talk about circular references, however I don't see the circular reference.  Any ideas? 

var iCount = 0;

function scrollUp() {
 oDiv = document.getElementById("content");
 while (oDiv.scrollTop < (550 * iCount)) {
  if (oDiv.scrollTop < (100 * iCount)) {
   iJump = 2;
  }
  else {
   if (oDiv.scrollTop < (500 * iCount)) {
    iJump = 5;
   }
   else {
    iJump = 1;
   }
  }
  oDiv.scrollTop += iJump;
 }
}

window.onload = function() {
 oLink = document.getElementById("link_next");
 oLink.onclick = function() {
  iCount += 1; 
  scrollUp();
  return false;
 }
}

thanks!

Started By dodonnell on Oct 25, 2005 at 2:20:55 AM

5 Response(s) | Reply

Earlier Replies | Replies 2 to 5 of 5 | Later Replies
dodonnell on Oct 25, 2005 at 2:47:20 AM (# 2)

well, no memory leak, just a big coding error.  The while loop never exited! sorry to waste your time.


6qing88 on Oct 31, 2005 at 2:42:38 AM (# 3)

Be serious,

the while loop is a infinite


MHenke on Oct 31, 2005 at 3:40:11 AM (# 4)

And where, seriously, is the difference between a while loop that never gets exited and an infinite one?


6qing88 on Nov 1, 2005 at 3:28:23 AM (# 5)

function scrollUp() {
 oDiv = document.getElementById("content");
 while (oDiv.scrollTop < (550 * iCount)) {             // While loop starts
  if (oDiv.scrollTop < (100 * iCount)) {           // If condition statement starts
   iJump = 2;
  }                                                              // End of the above if statement
  else {                                                       //
   if (oDiv.scrollTop < (500 * iCount)) {
    iJump = 5;
   }                                                           // End else
   else {                                                       //
    iJump = 1;
   }                                                              // End else
  }                                                               // I guess the position is end of the while loop
  oDiv.scrollTop += iJump;                           // In fact, oDiv.scrollTop just add iJump for one time

                                                                // For example: oDiv.scrollTop < 550 * iCount then the previous  while loop will never exit.
 }                                                             // End of the function
}                                                              // ??? Why?        the error ocurred


Earlier Replies | Replies 2 to 5 of 5 | Later Replies

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.