views:

645

answers:

6

Hi there! Some of you may have become very familiar with me in the past couple of days. (I've asked a TON of questions) Anyways, I was wondering what is the best way to debug jQuery? I don't really like having to bug you guys for the answers all the time so I was wondering if there is some tool, or method that you guys use to debug? Thanks a ton!!

+1  A: 

I use Firebug for Firefox

jchapa
+1 for firebug :)
Madi D.
+15  A: 

Firebug, Internet Explorer Developer Toolbar, Chrome Developer Tools. All are good ways for the respective browsers.

Some IDEs will let you debug inline.

just remember the javascript statement: debugger;

Quintin Robinson
+1 for firebug, also error console in in firefox shows the basic errors
Madi D.
+1 exactly what I would have said, but also don't forget Firebug Lite (for IE, Opera and Safari)
Jay
+1  A: 

Use the console in either Firefox with Firebug, or the built in one with Chrome/Safari.

Use a wrapper for the console, so it doesn't break in Internet explorer 6 and 7 tests.

Here's a good wrapper written by Ben Alman http://benalman.com/projects/javascript-debug-console-log/ to do just about everything you need safely.

Alex Sexton
A: 

The most common way will probably be to use the FireFox plugin called Firebug. Which has an excellent javascript debugger.

Hope this helps some.

Chris
A: 
console.log('blarg');

Then look at the console in Firebug, Firefox, Safari, etc.

carillonator
+4  A: 

jQuery.debug.js can:

  1. Write echo statements to Firebug's console.
  2. Debug selectors, and figure out what they're returning. [This is most helpful, IMO]
Jim G.