views:

52

answers:

1

I want to find that when a user fires an event, such as click a button, what function(s) does this event invoke at run-time? Would it be possible?

Thanks!

A: 

interesting question. add some debugging alert(), you will know what functions are triggered.

p.s. actually, the "function" you mean is the JavaScript internal function or the user-defined functions?

Shivan Raptor
I am guessing it is the internal functions, which is why I wasn't able to answer it without more details.
James Black
I would prefer user-defined functions. Basically I'm thinking to do some kind of profiling, by which I mean to trace the follow of functions handling users interactions. For example, when users click a button, it triggers an event handler, and what I'd like to know is which "real" functions handles this request. If users then click a link, which functions handling, so on and so forth...
Paul
BTW, I'd like it to be transparent to users so no alert() is prompted. Basically, it's not for debugging but for execution tracing. Also, I do want to change the source code but like to have a generic solution for an implemented application.
Paul