What are some good methods when debugging javascript?

So, I use JavaScript quite regularly, and I was wondering if there are any good tips or tricks in javascript debugging ... For example, I have a good one that I use quite regularly.

In my code, I would do something like this

window.p = $(this);

and in the console I can do my filtering as follows

window.p.next("li").find("a").val();

or what I need to do ... but it makes it easier to debug a specific place in the code, and I know that I have a lot of tips and tricks ... thanks in advance

I also looked at this question , and although it was useful, I was looking more for methods like mine above ...

+3
source share
2 answers

.

, console.log().

, , , console.profile() console.profileEnd()

$0. , HTML-, $0.

Firefox + Firebug Webkit ( Chrome Safari). Chrome, ( Paul Irish)

jQuery FireQuery

+3

jQuery Lint http://james.padolsey.com/javascript/jquery-lint/. jQuery . Lint , jQuery, Firebug Developer Tools. -.

http://getfirebug.com/logging console . Firefox Firebug Webkit (Chrome, Safari...) .

+3

All Articles