[jQuery] Re: event.currentTarget with table rows and IE7
Woah, I just noticed (2 minutes after my reply) this post: http://brandonaaron.net/blog/2009/05/12/jquery-edge-bind-with-a-different-this That says in 1.3.3 that currentTarget will be normalised cross-browser too. On Sep 19, 7:00 am, Philipp wrote: > Hi, > > I got a problem using the following code: > > $j = jQuery.noConflict(); > $j(document).ready(function(){ > $j('tr').mouseover(function(event) { > if (!event.currentTarget) { > alert('current target not given!'); > return false; > } > alert(event.currentTarget.id); > }); > > }); > > When hovering a table data (td) element in Firefox everything works > fine: The id value of the row is displayed. In IE7 my error message is > displayed. > > I would appreciate any ideas which would solve this problem. > Kind regards > Philipp
[jQuery] Re: event.currentTarget with table rows and IE7
The event you get from jQuery handlers is normalised. CurrentTarget is just "this" in the function. mouseover(event){ alert(this.id); } On Sep 19, 7:00 am, Philipp wrote: > Hi, > > I got a problem using the following code: > > $j = jQuery.noConflict(); > $j(document).ready(function(){ > $j('tr').mouseover(function(event) { > if (!event.currentTarget) { > alert('current target not given!'); > return false; > } > alert(event.currentTarget.id); > }); > > }); > > When hovering a table data (td) element in Firefox everything works > fine: The id value of the row is displayed. In IE7 my error message is > displayed. > > I would appreciate any ideas which would solve this problem. > Kind regards > Philipp