Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
189
rated 0 times [  192] [ 3]  / answers: 1 / hits: 41088  / 13 Years ago, fri, april 15, 2011, 12:00:00

Is it possible to view JavaScript function calls in the browser's JavaScript console? I know you can view XHR, but can you view function calls?



For example, I hover my mouse over some element on a page and a div pops up. I know there was a JavaScript function that was called to show the popup so it would be nice to be able to view this call in the console so I can see what function was called.



Am I missing something or is this not possible?


More From » debugging

 Answers
40

So basically you want to view JS calls in real-time?



The Firebug extension on Firefox offers that (http://getfirebug.com/javascript).



Basically, what you want to do is find your function within your code, then set a breakpoint on it. You should then be able to step through execution on it, just like a normal debugger. It shouldn't be hard to find the JS function associated with a and a particular event (e.g. mouseover) on that - is this page in question using straight JS or a framework? And if so, which one?



Google Chrome's built-in developer tools offer a smaller subset - depending on what you want, the Profile tab on it might be useful?



What exactly do you need to trace this JS function for? We might be able to recommend a better tool for you based on your particular need.


[#92713] Thursday, April 14, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
longd

Total Points: 616
Total Questions: 110
Total Answers: 101

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
;