views:

2425

answers:

10

Currently, I don't really have a good method of debugging javascript in internet explorer and safari. In Firefox, you can use Firebug's Logging feature and Command Line functions. However, this doesn't help me when I move to other browsers.

+2  A: 

This post on the IE Blog explains different options for script debugging in IE.

Here is the Apple Dev FAQ on debugging Javascript in Safari.

Yaakov Ellis
+1  A: 

Safari 3.0 and 3.1 include the Drosera JavaScript debugger, which you can enable on the Mac by following the instructions at that link. There's also the Safari Web Inspector..

Chris Hanson
+8  A: 

For Safari you need to enable the "Develop" menu via Preferences (in Safari 3.1; see the entry in Apple's Safari development FAQ) or via

$ defaults write com.apple.Safari IncludeDebugMenu 1

at the terminal in Mac OS X. Then from the Develop menu choose Show Web Inspector and click on the Console link. Your script can write to the console using window.console.log.

For Internet Explorer, Visual Studio is really the best script debugger but the Microsoft Script Debugger is okay if you don't have Visual Studio. This post on the IE team blog walks you through installing it and connecting to Internet Explorer.

Internet Explorer 8 looks like it will have a very fancy script debugger, so if you're feeling really adventurous you could install the Internet Explorer 8 beta and give that a whirl.

Dominic Cooney
There's UI in Safari for enabling the developer tools now. Go to Safari, Preferences, Advanced and check the "Show Develop in menu bar" option.
Dominic Cooney
A: 

There is now a Firebug Lite that works on other browsers such as ie, safari and opera built it does have a limited set of commands and is not as full as the version in firefox.

If you are using asp.net in visual studio 2008 will also debug JavaScript in IE.

John
+5  A: 

This is the Firebug Lite that @John was referring to that works on IE, Safari and Opera.

jtyost2
+2  A: 

Also, for Internet Explorer, have a look at DebugBar

Mark Renouf
A: 

Visual Studio 2005 has the Script Explorer (under the Debug > Windows menu). It shows a tree of all the scripted stuff that's currently debuggable. Previously I was breaking into the debugger via IE's View > Script Debugger menu, but I'm finding the Script Explorer is a quicker way to get to what I want.

robaker
A: 

Safari 3.1 doesn't need any magical commandline preferences -- the Advanced tab of the preferences window has an enable develop menu checkbox. That said if you can use the webkit nightlies (http://nightly.webkit.org), you're probably better off doing that as the developer tools are vastly improved, and you can more easily file bug reports requesting features that you want :D

olliej
+1  A: 

The best method I've used for debugging JavaScript in Internet Explorer is through the Microsoft Script Editor. The debugger is full featured and very easy to use.

The article bellow teaches how to install the Microsoft Script Editor and configure it.

HOW-TO: Debug JavaScript in Internet Explorer

for Safari, sorry no answer...

Daniel Silveira
A: 

See the Debugging chapter of the Safari User Guide for Web Developers for full documentation of how to debug in Safari. (For the most part it is the same API as Firebug.)

In IE you can use the IE Dev Tools, but I prefer Firebug Lite as others have mentioned.

Pullets Forever