SweatCoder
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/Transla tionWYSIWY G/common.j s"></SCRIP T>
<SCRIPT LANGUAGE="JavaScript" SRC="JavaScripts.js"></SCR IPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" onLoad="expandTree(folders Tree)" onScroll="top.PermsRight.s crollTo(0, document.b ody.scroll Top)">
<!-- Infrastructure code for the treeview -->
<script src="TreeView_Permissions. js"></scri pt>
<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 ","","#FFF FFF","","" ,"",""))
fSubSub.xID = 119
fSubSub = insFld(fSub,gFld("Electric al","","#E DEBF1","", "","",""))
fSubSub.xID = 120
fSubSub = insFld(fSub,gFld("Machinar y","","#FF FFFF",""," ","",""))
fSubSub.xID = 121
fSubSub = insFld(fSub,gFld("Structua l","","#ED EBF1",""," ","",""))
fSubSub.xID = 122
fSub = insFld(f,gFld("Documents", "","#FFFFF F","",""," ",""))
fSub.xID = 117
fSubSub = insFld(fSub,gFld("Approval ","","#EDE BF1","","" ,"",""))
fSubSub.xID = 123
fSubSub = insFld(fSub,gFld("Reports" ,"","#FFFF FF","","", "",""))
fSubSub.xID = 124
fSub = insFld(f,gFld("Images","", "#EDEBF1", "","",""," "))
fSub.xID = 118
fSubSub = insFld(fSub,gFld("Equipmen t","","#FF FFFF",""," ","",""))
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.findOb j(xID);
docObj.forceOpeningOfAnces torFolders ();
parent.UserHomeLeft.clickO nLink(xID, docObj.lin k,'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.docume nt.body != "undefined"){ //scroll doesn work with NS4, for example
parent.UserHomeLeft.docume nt.body.sc rollTop=do cObj.navOb j.offsetTo p
}
}
</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,folder ID,fileID) {
launchWindow("Subscribe.as p?SessionI D=07Og9oI% &ProjectID =" + projectID + "&FolderID=" + folderID + "&FileID=" + fileID,500,350)
}
function launchWindow(url,width,hei ght){
var theLaunchedWindow = window.open(url.replace(/# /g,"%23"), "","scroll bars,resiz able,width =" + width + ",height=" + height)
}
</script>
</FORM>
</BODY>
</HTML>
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/Transla
<SCRIPT LANGUAGE="JavaScript" SRC="JavaScripts.js"></SCR
</HEAD>
<BODY BGCOLOR="#FFFFFF" onLoad="expandTree(folders
<!-- Infrastructure code for the treeview -->
<script src="TreeView_Permissions.
<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","
fSub.xID = 116
fSubSub = insFld(fSub,gFld("Plumbing
fSubSub.xID = 119
fSubSub = insFld(fSub,gFld("Electric
fSubSub.xID = 120
fSubSub = insFld(fSub,gFld("Machinar
fSubSub.xID = 121
fSubSub = insFld(fSub,gFld("Structua
fSubSub.xID = 122
fSub = insFld(f,gFld("Documents",
fSub.xID = 117
fSubSub = insFld(fSub,gFld("Approval
fSubSub.xID = 123
fSubSub = insFld(fSub,gFld("Reports"
fSubSub.xID = 124
fSub = insFld(f,gFld("Images","",
fSub.xID = 118
fSubSub = insFld(fSub,gFld("Equipmen
fSubSub.xID = 125
fSubSub = insFld(fSub,gFld("Sites","
fSubSub.xID = 126
fSub = insFld(f,gFld("Incoming","
fSub.xID = 127
fSubSub = insFld(fSub,gFld("Email","
fSubSub.xID = 128
fSubSub = insFld(fSub,gFld("Fax","",
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.findOb
docObj.forceOpeningOfAnces
parent.UserHomeLeft.clickO
//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.docume
parent.UserHomeLeft.docume
}
}
</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
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,folder
launchWindow("Subscribe.as
}
function launchWindow(url,width,hei
var theLaunchedWindow = window.open(url.replace(/#
}
</script>
</FORM>
</BODY>
</HTML>
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
TreeView_Permissions.js
is also adding onmouseovers I am sure
ASKER
You can grab these files from this base location:
http://phoenix2.infograph.com/PdoxJ/
examples:
http://phoenix2.infograph.com/PdoxJ/JavaScripts.js
http://phoenix2.infograph.com/PdoxJ/Integration/TranslationWYSIWYG/common.js
etc.
http://phoenix2.infograph.com/PdoxJ/
examples:
http://phoenix2.infograph.com/PdoxJ/JavaScripts.js
http://phoenix2.infograph.com/PdoxJ/Integration/TranslationWYSIWYG/common.js
etc.
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<SCRIPT LANGUAGE="JavaScript" SRC="./Integration/Transla
<SCRIPT LANGUAGE="JavaScript" SRC="JavaScripts.js"></SCR
No attachEvent or document.onmouseover or something?