views:

139

answers:

8

I don't get any error in firefox or firebug, but yet in IE I get invalid argument for some reason, and I can't figure out what is the invalid argument, the javascript halts when "error" is discovered .. what can I do to debug it ?

+1  A: 

get internet explorer 8, or the internet explorer developer toolbar

Paul Creasey
+3  A: 

If you're running IE8, you can use the developer tools by pressing F12. You can also download them for IE7.

Andy E
You can also download the developer toolbar for IE 6. It makes life much much better.
smaclell
+5  A: 

Firebug Lite is awesome.

Mark
+1 for learning me something new. Looks indeed great.
BalusC
+2  A: 

Enable the script debugger in IE.

Note that with jquery or mootools 90% of the IE bugs (when it works fine in FF) is because I didn't explicitly extend an element I was working with.

In firefox you can just say element.jquery_function(), however with IE the element must be explicitly extended with element = $(element), or just get in the habit of writing $(element).jquery_function().

You didn't give enough info to debug your problem, but i'd guess that is a good place to start.

note: I use mootools but i'm assuming this also applies to jquery

Rob
+3  A: 

If you have Visual Studio you can use it directly to debug javascript. First uncheck the advanced IE settings "Disable script debugging" then attach VS to the IExplorer process (Tools => Attach To Process then find the process).

Clearly this is not the easiest option here but can work in a pinch. If you are already using VS to do your development just disabling script debugging and launching your website with IE will allow the JS debugger to work automatically.

smaclell
A: 

I would use a cross-browser logging library such as my own log4javascript.

Tim Down
A: 

I prefer DebugBar over Firebug Lite.

Nikki Erwin Ramirez
A: 

If you're on IE 8, that comes bundled with developer tools (http://msdn.microsoft.com/en-us/library/dd565628(VS.85).aspx).

If you're on IE 7 or 6, there's the free IE Developer Toolbar from Microsoft (http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en).

There's also Companion.JS for IE 6/7 (http://www.my-debugbar.com/wiki/CompanionJS/HomePage).

chimerical