Link to home
Start Free TrialLog in
Avatar of SweatCoder
SweatCoderFlag for United States of America

asked on

mouseover - max cpu

I have a couple of web pages that have a fair amount of javascripting. When I mouseover text labels or checkboxes, the client-side cpu goes very high, almost to 100%, and stays there until you mouse-off the label or checkbox. The strange thing is, there are no onmouseover or onmouseout anywhere. I'm using IE7 B2, but the same symptom happens on IE6. What could be causing this?

One of my pages that exhibits this symptom:


<HTML>
<HEAD>
      
      <TITLE>My Page</TITLE>
      <LINK REL="stylesheet" HREF="Custom/Style.css" type="text/css">
      <SCRIPT LANGUAGE="JavaScript" SRC="./Integration/TranslationWYSIWYG/common.js"></SCRIPT>
      <SCRIPT LANGUAGE="JavaScript" SRC="JavaScripts.js"></SCRIPT>
</HEAD>

<BODY BGCOLOR="#FFFFFF" onLoad="expandTree(foldersTree)" onScroll="top.PermsRight.scrollTo(0,document.body.scrollTop)">


<!-- Infrastructure code for the treeview -->
<script src="TreeView_Permissions.js"></script>

<script>
      ROWCOLOR = ""
      USETEXTLINKS = 1
      STARTALLOPEN = 0
      PERSERVESTATE = 0 //don't preserve state of tree when coming from View Projects
      ICONPATH = 'images/'

      foldersTree = gFld("Experts Exchange Test Project", "","","","","","")
f = foldersTree
f.xID = 0
fSub = insFld(f,gFld("Drawings","","#EDEBF1","","","",""))
fSub.xID = 116
fSubSub = insFld(fSub,gFld("Plumbing","","#FFFFFF","","","",""))
fSubSub.xID = 119
fSubSub = insFld(fSub,gFld("Electrical","","#EDEBF1","","","",""))
fSubSub.xID = 120
fSubSub = insFld(fSub,gFld("Machinary","","#FFFFFF","","","",""))
fSubSub.xID = 121
fSubSub = insFld(fSub,gFld("Structual","","#EDEBF1","","","",""))
fSubSub.xID = 122
fSub = insFld(f,gFld("Documents","","#FFFFFF","","","",""))
fSub.xID = 117
fSubSub = insFld(fSub,gFld("Approval","","#EDEBF1","","","",""))
fSubSub.xID = 123
fSubSub = insFld(fSub,gFld("Reports","","#FFFFFF","","","",""))
fSubSub.xID = 124
fSub = insFld(f,gFld("Images","","#EDEBF1","","","",""))
fSub.xID = 118
fSubSub = insFld(fSub,gFld("Equipment","","#FFFFFF","","","",""))
fSubSub.xID = 125
fSubSub = insFld(fSub,gFld("Sites","","#EDEBF1","","","",""))
fSubSub.xID = 126
fSub = insFld(f,gFld("Incoming","","#FFFFFF","","","",""))
fSub.xID = 127
fSubSub = insFld(fSub,gFld("Email","","#EDEBF1","","","",""))
fSubSub.xID = 128
fSubSub = insFld(fSub,gFld("Fax","","#FFFFFF","","","",""))
fSubSub.xID = 129


      // Load a page as if a node on the tree was clicked (synchronize frames)
      // (Highlights selection if highlight is available.)
      function loadSynchPage(xID){
            var folderObj;
            docObj = parent.UserHomeLeft.findObj(xID);
            docObj.forceOpeningOfAncestorFolders();
            parent.UserHomeLeft.clickOnLink(xID,docObj.link,'basefrm');

          //Scroll the tree window to show the selected node
          //Other code in these functions needs to be changed to work with
          //frameless pages, but this code should, I think, simply be removed
            if (typeof parent.UserHomeLeft.document.body != "undefined"){ //scroll doesn work with NS4, for example
              parent.UserHomeLeft.document.body.scrollTop=docObj.navObj.offsetTop
          }
      }
</script>

<!-- Build the browser's objects and display default view of the tree. -->
<script>
      initializeDocument()
            
      function reviewCheckBoxes(){
            elems = document.forms[0].elements
            ok = false
            for(rcb=0;rcb<elems.length;rcb++){ //using rcb so it doesn't collide with any "i's" in the other js
                  if(elems[rcb].type == "checkbox" && elems[rcb].checked){
                        ok = true
                  }
            }
            if(ok){
                  document.forms[0].submit()
            }else{
                  alert("You must check at least one box.")
            }
      }
      function subscribe(projectID,folderID,fileID){
            launchWindow("Subscribe.asp?SessionID=07Og9oI%&ProjectID=" + projectID + "&FolderID=" + folderID + "&FileID=" + fileID,500,350)
      }
      function launchWindow(url,width,height){
            var theLaunchedWindow = window.open(url.replace(/#/g,"%23"),"","scrollbars,resizable,width=" + width + ",height=" + height)
      }
</script>
</FORM>
</BODY>
</HTML>
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

How about
  <SCRIPT LANGUAGE="JavaScript" SRC="./Integration/TranslationWYSIWYG/common.js"></SCRIPT>
  <SCRIPT LANGUAGE="JavaScript" SRC="JavaScripts.js"></SCRIPT>

No attachEvent or document.onmouseover or something?
Avatar of SweatCoder

ASKER

I did find one attachEvent in common.js, but even when I removed the linkage to that file, the problem still occurred.
Impossible to help when we do not have the complete files.
TreeView_Permissions.js
is also adding onmouseovers I am sure
I found the problem. I had a css file that was doing dynamic stuff and got into an infinite loop in the JS.
ASKER CERTIFIED SOLUTION
Avatar of BooMod
BooMod
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial