wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Debugging jQuery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Debugging jQuery" Watch "Debugging jQuery" New topic
Author

Debugging jQuery

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5126
    
  12

Everybody who developed JS knows that debugging isn't easy. Thanks to Firebug life of a web developer has become a lot easier But you don't always have Firebug to the rescue (if you have to develop an inhouse application for Internet Explorer only for example). Does jQuery provide some debugging utilities/tools (something similar to log4j, like the console used by dojo toolkit), or are you stuck with the window alert?

And when I see jQuery snippets, they often (always) use chaining, for example:


Can this be easily debugged through Firebug and/or with the jQuery debugging utilities/tools? Or do you have to break it down in single lines to ease the debugging process?


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Firebug itself provides logging support: http://getfirebug.com/logging


GenRocket - Experts at Building Test Data
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

I use Firebug and Firebug Lite, and HttpFox.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5126
    
  12

As far as I know Firebug and HttpFox are add-ons for Firefox. Firebug Lite can be used with other major browsers like IE, but doesn't provide a js debugger.

So the question still stands (unless I'm wrong): does jQuery provide debugging utilities/tools when you have to develop js for IE only (because it's not publicly accessible and IE is the standard and only browsers used in the company).
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

No.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
IE8 has a great debugger built into it. So many people have no clue that it is there.

IE8 runs as IE7

Eric
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

There seem to be quite a few plugin's that integrate into firebug's console. I found a couple that (they say) work cross browser. Mostly something that emulate the console - http://sites.google.com/site/jollytoad/browsercompatibility and http://code.google.com/p/jquery-console/

But I guess between the IE7/8 debugger and Firebug you might not want to really look (much) at other tools!


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 977
...have a look at the following How to Debug Your jQuery Code

The article explains in detail some debugging possibilities.

Gian


"Eppur si muove!"
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5126
    
  12

Eric Pascarello wrote:IE8 has a great debugger built into it. So many people have no clue that it is there.


Indeed I didn't know that I developed an in-house IE6 web application 5-6 years ago and I know debugging the JS with Microsoft Script Debugger was most of the time really frustrating. Glad to hear they have a decent one now

Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Roel De Nijs wrote:
Eric Pascarello wrote:IE8 has a great debugger built into it. So many people have no clue that it is there.


Indeed I didn't know that I developed an in-house IE6 web application 5-6 years ago and I know debugging the JS with Microsoft Script Debugger was most of the time really frustrating. Glad to hear they have a decent one now



If you have Visual Studio or visual web developer express you could always hook up IE6/7 into it and walk the code too.

Eric
Himalay Majumdar
Ranch Hand

Joined: Sep 28, 2008
Posts: 324
IE Tester is another good tool. It allows you to test all IE versions in demand.

-Himalay


SCJP 1.6, SCWCD 5.0, SCBCD 5.0 [loading..]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Debugging jQuery
 
Similar Threads
jQuery UI Widget issue
problem with java script
Ajax: preferred IDE and libraries
Getting null while trying to get value of Multiple list
Element which starts as hidden, does not display using jQuery show() method