简体   繁体   中英

How to find out what event cause a javascript function to be executed in FireFox?

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.

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.

最棒的CSS,javascript,html,dom,一切 - 其他扩展: Firebug

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM