zino66
2009-12-11 16:51:01 UTC
I have the following:
the HTML page has this DIV:
..... .... .. .
<div id="myTask">
... .. . . ...
the javascript file is:
window.onload=function()
{
document.getElementById("myTask").onmouseover=tab_mouseover;
tab_mouseover.apply(document.getElementById("myTask"));
}
function tab_mouseover(evt)
{
var evt = (evt) ? evt : ((window.event) ? event : null);
var from = (window.event) ? evt.srcElement : evt.target; //generate error
var to = (evt.relatedTarget) ? evt.relatedTarget : evt.toElement;
while (to && to != from && to.nodeName != 'BODY'){ to = to.parentNode; }
if (to == from) return;
}
the "evt.srcElement" is always null. How can I solve it?
I tried it in IE 6 and IE8
thanks for help
the HTML page has this DIV:
..... .... .. .
<div id="myTask">
... .. . . ...
the javascript file is:
window.onload=function()
{
document.getElementById("myTask").onmouseover=tab_mouseover;
tab_mouseover.apply(document.getElementById("myTask"));
}
function tab_mouseover(evt)
{
var evt = (evt) ? evt : ((window.event) ? event : null);
var from = (window.event) ? evt.srcElement : evt.target; //generate error
var to = (evt.relatedTarget) ? evt.relatedTarget : evt.toElement;
while (to && to != from && to.nodeName != 'BODY'){ to = to.parentNode; }
if (to == from) return;
}
the "evt.srcElement" is always null. How can I solve it?
I tried it in IE 6 and IE8
thanks for help