Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to trace Javascript code [closed]

What is the best way to debug Javascript code using any tool..i.e. i want to know when a button is clicked, what all JS code gets executed...

I wanted to test in Firefox and Safari..Already tried Firebug, but want to know if there is any better way..

Also more importantly i want to know "how" exactly to debug the code?

Also is it possible to print the complete JS code that gets called when I say press a button?

like image 261
copenndthagen Avatar asked May 30 '11 17:05

copenndthagen


2 Answers

I always use the integrated web inspector tool from Google Chrome (you know, right-click, Inspect element). It works quite well for me, and has all the functions I need.

like image 86
RobinJ Avatar answered Oct 20 '22 15:10

RobinJ


This post, using FireFox's FireBug and jQuery, might help you detect and capture all of the events bound to a button so you can tell what JS code is run when the button is clicked:

How to debug JavaScript/jQuery event bindings with Firebug (or similar tool)

like image 28
thaddeusmt Avatar answered Oct 20 '22 16:10

thaddeusmt