Thursday, March 8, 2012

Debugging Dojo with Chrome

As a web developer I spend many hours working with javascript libraries like dojo. Unfortunately, in many cases the javascript in these libraries is compressed making it very difficult to trace in a debug session.

Chrome is Your New Best Friend
Google's chrome developer tools has many bells and whistles, some of which I've only discovered in the last week. One feature that I think is worthy of mention is the pretty print button, tucked away at the bottom of the page in the status bar.


Click on the button and dojo.js goes from this:


to this:


Some of the variables are still compressed, but now the code becomes legible and breakpoints can be added with ease.

Yes, it also works with JQuery.
Please note that generic comments containing links with the intent of self promotion will be flagged as spam and deleted.

0 comments:

Post a Comment

Are you about to post a generic comment that has nothing to do with this post? Something like "Hey thanks for this very valuable information, BTW here's my website". If so, it will be marked as spam and deleted within 24 hours.

Note: Only a member of this blog may post a comment.