views:

282

answers:

4

I'm debugging an old Infragistic grid. One of the javascript functions executes more times than needed. It was coded to be executed when a user clicks a cell in the grid. However, sometimes it runs when on mouse is over the cell. I'd like to know if there's a way to track what event caused this function to run.

Multiple executions of that function happens only in FireFox, IE behaves as it intended.

A: 

This could be an issue of event bubbling. Check to see if any elements containing your event also handle it.

Zack
+2  A: 

The most awesome css, javascript, html, dom, everything-else extension: Firebug.

Wayne Hartman
+3  A: 

Firebug has a really helpful debugger : http://getfirebug.com/js.html

There is a nice tutorial here that will tell you all what you need to know.

marcgg
A: 

The simplest way to track the event is to make a syntax error within the event handler, f.e. alert(non_existing_object). When the error is encounterd, Firebug shows function call stack trace (must be set before in it's settings).

Thevs