for mozilla event to be captured we write
[code=html]
<script>
function temp(event)
{
alert(event.cli entX);
}
</script>
<div onmouseover="te mp(event)">
[/code]
Now in case of objects,how do i capture events for mozilla
The problem is as follows
[CODE=javascript]
function temp()
{
this.div=docume nt.createElemen t('div');
this.div.id="ab c";
this.div.onmous ehover=function (){this.abc(eve nt)}/*<------Here event is undefined
so function is not called for
mozilla*/
this.div.onclic k=this.abc//<-----Here object reference is lost
}
temp.prototype. abc=function(ev e)
{
alert(eve.clien tX);
}
[/CODE]
[code=html]
<script>
function temp(event)
{
alert(event.cli entX);
}
</script>
<div onmouseover="te mp(event)">
[/code]
Now in case of objects,how do i capture events for mozilla
The problem is as follows
[CODE=javascript]
function temp()
{
this.div=docume nt.createElemen t('div');
this.div.id="ab c";
this.div.onmous ehover=function (){this.abc(eve nt)}/*<------Here event is undefined
so function is not called for
mozilla*/
this.div.onclic k=this.abc//<-----Here object reference is lost
}
temp.prototype. abc=function(ev e)
{
alert(eve.clien tX);
}
[/CODE]
Comment