Hi guys! I have a problem: When I fill a div with
document.getElementById.innerHTML the onmouseover doesn't work anymore.
I use onmouseover to call a javascript which shows a tooltip. The
javascript is located at the end of the html file. The div content is
exactly the same as at the initial load of the webpage. When I replace
the call of the tooltip-js with a simple alert() everything works fine,
even after the refreshing of the div.
Source Code is here:
http://de.pastebin.ca/296905
Thanks in advance and greetings
Dieter
this working fine (firefox 1.5.0.7 and ie
6.0.2900.2180.xpsp_sp2_gdr050301-1519)
<html>
<head>
<script>
myFunc = {
"msg" : function()
{
alert("my string");
},
"onEvent" : function()
{
_this = myFunc;
_this.msg.call(_this);
}
}
myFunc.onEvent();
</script>
<style>
.red
{
border: 1px solid #f00;
height: 100px;
width: 100px;
}
.green
{
border: 1px solid #0f0;
height: 100px;
width: 100px;
}
</style>
</head>
<body>
<div id="div1">
</div>
<br />
<div id="div2" class="green">
</div>
</body>
<script>
document.getElementById("div1").innerHTML = '<div class="red"
onmouseover="myFunc.onEvent()"></div>';
document.getElementById("div2").onmouseover = myFunc.onEvent;
</script>
</html>
On 12/30/06, Dieter Bauster <DerDie@gmail.com> wrote:
> Hi guys! I have a problem: When I fill a div with
> document.getElementById.innerHTML the onmouseover doesn't work anymore.
> I use onmouseover to call a javascript which shows a tooltip. The
> javascript is located at the end of the html file. The div content is
> exactly the same as at the initial load of the webpage. When I replace
> the call of the tooltip-js with a simple alert() everything works fine,
> even after the refreshing of the div.
> Source Code is here:
> http://de.pastebin.ca/296905
> Thanks in advance and greetings
> Dieter
--
Sem mais para o momento,
Rodrigo Souza
--------------------------------------------------------------------------- -----
:: Rodrigo Souza dos Santos
:: Curitiba - Paran - Brasil
:: rodrigosouzadossan@gmail.com
--------------------------------------------------------------------------- -----