P
pamelafluente
Hi
It's 2 days I am struggling with 1 stupid line of code.
I have the following function which works if I do not do the dynamic
code insert:
document.body.innerHTML += "<form name='form1'
method='GET'><input type='hidden' name='actionCodes'
id='actionCodesField' /></form>"
But if I add the above, the handlers are no more attached. I cannot
understand what is my error? Am I doing it the wrong way? Perhaps it's
wrong to do this onload ? Can anybody help and show me the right way to
add code to the body onload ?
-Pam
---------- function
window.onload = addHandlers;
function addHandlers() {
var DivInstanceID = document.getElementById("InstanceID");
if ( DivInstanceID != null ) {
InstanceID = DivInstanceID.getAttribute("InstanceID");
}
window.status = "Attaching Drill down / Roll up handlers...";
var aDivs = document.getElementsByTagName("div");
var divElement;
for ( var i = 0; i < aDivs.length; i++ ) {
divElement = aDivs;
if ( divElement.getAttribute(EnabledActionsAttribute) != null )
{
divElement.onclick = function(event) { doOnclick(event,
this) };
divElement.onmouseover = function() { doOnmouseover(this)
};
divElement.onmouseout = function() { doOnmouseout(this) };
}
}
document.body.innerHTML += "<form name='form1'
method='GET'><input type='hidden' name='actionCodes'
id='actionCodesField' /></form>"
window.status = "handlers attached";
}
It's 2 days I am struggling with 1 stupid line of code.
I have the following function which works if I do not do the dynamic
code insert:
document.body.innerHTML += "<form name='form1'
method='GET'><input type='hidden' name='actionCodes'
id='actionCodesField' /></form>"
But if I add the above, the handlers are no more attached. I cannot
understand what is my error? Am I doing it the wrong way? Perhaps it's
wrong to do this onload ? Can anybody help and show me the right way to
add code to the body onload ?
-Pam
---------- function
window.onload = addHandlers;
function addHandlers() {
var DivInstanceID = document.getElementById("InstanceID");
if ( DivInstanceID != null ) {
InstanceID = DivInstanceID.getAttribute("InstanceID");
}
window.status = "Attaching Drill down / Roll up handlers...";
var aDivs = document.getElementsByTagName("div");
var divElement;
for ( var i = 0; i < aDivs.length; i++ ) {
divElement = aDivs;
if ( divElement.getAttribute(EnabledActionsAttribute) != null )
{
divElement.onclick = function(event) { doOnclick(event,
this) };
divElement.onmouseover = function() { doOnmouseover(this)
};
divElement.onmouseout = function() { doOnmouseout(this) };
}
}
document.body.innerHTML += "<form name='form1'
method='GET'><input type='hidden' name='actionCodes'
id='actionCodesField' /></form>"
window.status = "handlers attached";
}