Ease your JavaScript testing and debugging load

Daily Newsletters

Sign up to ZDNet UK's daily newsletter.

Topics

JavaScript, debug

... browser tools and IDEs.

Browser options
While Internet Explorer is the most popular browser, its JavaScript debugging support is rudimentary. A window will display if JavaScript errors occur. The error messages (as with most JavaScript errors) leave much to be desired, but they do let you know which errors occur. The messages include a line number (even though it never corresponds to the actual offending line, it does place you in the vicinity).

Also, it can launch an external application for debugging (Visual Studio if installed) or examining the code. Note: You enable JavaScript debugging by going to Tools | Options.

Mozilla-based browsers provide options as well. Firefox includes the JavaScript console that displays messages (errors, warnings, information) about scripts on the current page. It actually displays the offending code with an arrow pointing to where the error occurred.

Netscape and Opera includes the JavaScript console as well. Some browsers include special syntax for debugging. A good example is Opera, which supports the opera.postError() command to send output to the console. The Safari browser Debug menu allows you to turn on the logging of JavaScript errors, and they will appear in its console.

IDE options
You may be able to debug browser-based applications via your favorite IDE. Visual Studio is one example that allows you to debug Internet Explorer applications via its debugging support. You must have debugging enabled on the Web server (IIS). Follow these steps to use it:

  1. Start the Web application in debug mode (Debug | Start).
  2. The application launches in a browser window. Return to the Visual Studio client. Select Debug | Window | Running Documents.
  3. The currently running application will appear in the Running Documents window. You can select the Web form and actually place breakpoints in the JavaScript code.
  4. Return to the Web form and use the application; execution will halt at any JavaScript breakpoints inserted.

    Visual Studio is not alone with its debug support. For example, Dreamweaver includes their own JavaScript Debugger that allows you to debug syntax and logic errors, as well as setting breakpoints, watching variables, and stepping through code. A nice feature is the inclusion of an explanation of any JavaScript errors in plain English.

    You may also use a standalone JavaScript debugger tool. A good example is SplineTech's JavaScript HTML Debugger, which is a full-featured development tool. If you use the Eclipse IDE, JSEclipse is an Eclipse plug-in for JavaScript development.

    Another language to debug
    JavaScript has evolved into the standard for Web client scripting. It has an overwhelming number of language resources, but development support is not as readily available. Most developers working with JavaScript tend to use older approaches to debugging, but there are many tools available today to ease the testing and debugger load.

Talkback

<cough>Venkman</cough>

via Facebook 10 May, 2006 19:19
Reply

Post your comment

In order to post a comment you need to be registered and logged in.

You can also log in with Facebook. Log in or create your ZDNet UK account below

  • Login

Will not be displayed with your comment

By signing up for this service, you indicate that you agree to our Terms and Conditions and have read and understood our Privacy Policy. Questions about membership? Find the answers in the Community FAQ

Get ZDNet UK's daily newsletter

Enter your email address to sign up

ZDNet UK Live

TerryRK

Well it seems there is something a number of us agree on. Why is the Ubuntu Unity launcher so ugly? I thought perhaps it was something to do with...

39 minutes ago by TerryRK on A tale of two distros: Ubuntu and Linux Mint
Freebies202

Duplicate comments are not made intentionally. Its very good to know that now you are keeping check on this problem because sometimes a commenter...

10 hours ago by Freebies202 on Microsoft fixes blog comments, speeds up blogs with open source
kevinmchapman

"the very significant number of users" and "many (most) of us" - you have no evidence for these statements. It is a fact that most users are saying...

18 hours ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
Marg Menzies Harrison

Another grammar faux pas is the improper use of "you". When sitting down down in a restaurant, for example, I get cringe when the waitress...

20 hours ago by Marg Menzies Harrison via Facebook on 10 flagrant grammar mistakes that make you look stupid
zdnetukuser

And NOW, folks, for Canonical's next trick... Kubuntu is late. Here's a pencil. Draw your own conclusions. cf.:...

20 hours ago by zdnetukuser on Linux Minterface
Moley

@kevinmchapman. The discussion here reflects the very significant number of users who really do like the traditional menu system and who wish to...

22 hours ago by Moley on A tale of two distros: Ubuntu and Linux Mint
kevinmchapman

Er, no... It is an efficient means of finding the application/file/setting you need in one place. The icons are a simply a fallback for when you...

24 hours ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
TerryRK

Isn't the provision of a text based search an admission by the developers that the mass of icons approach does not work? I don't need to use a...

1 day ago by TerryRK on A tale of two distros: Ubuntu and Linux Mint
kevinmchapman

"Unity and GNOME 3 both abandon the old text-based cascading menus in favour of a graphical icon-driven system." Point truly missed. Both use a...

1 day ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
TerryRK

whs001 - Thank you, I'm glad you liked the article. I absolutely agree with you on your first point. I should perhaps have made it clearer that...

1 day ago by TerryRK on A tale of two distros: Ubuntu and Linux Mint
Dennis Nilsson

If we allow corporate interest to dictate the way our government circumvents due process against foreign entities then we should accept the same...

1 day ago by Dennis Nilsson via Facebook on ACTA stumbles in Germany
GHar123

I totally dislike pirating of works, I fear that artists will be deterred from creating works if they think that they are going to get ripped off....

1 day ago by GHar123 on ACTA stumbles in Germany
JCB33

How dare film makers, artists or anybody that invests in creativity stop us pirating their works for free. I want to be able to walk into my local...

1 day ago by JCB33 on ACTA stumbles in Germany
Moley

@GrueMaster. I prefer horses for courses rather than one size fits all. I, and I suspect most other computer users, do not really wish to have...

2 days ago by Moley on A tale of two distros: Ubuntu and Linux Mint
greycynic

The product that scares me every time I have to use it is the Office 2007 version of Excel. The first bug that I found was applying the median...

2 days ago by greycynic on Ten flawed products that derail productivity
GrueMaster

Nice review and very informative. One thing I'd like to add (in reply to whs001's 1st question), the main reason to have the same interface from...

2 days ago by GrueMaster on A tale of two distros: Ubuntu and Linux Mint
Frederick Wrigley

I'be been using Mint 12 since the RC came out, and I am far more happy with the Cinnamon, the Mate, and, yes (with extensions), theGnome 3...

2 days ago by Frederick Wrigley via Facebook on A tale of two distros: Ubuntu and Linux Mint
bdantas

Excellent article. One small correction, though--although a fresh installation of Linux Mint 12 will, indeed, provide the user with a version of...

2 days ago by bdantas on A tale of two distros: Ubuntu and Linux Mint
Alan Ralph

In related news, the ISPs club together to get the members of the Home Affairs Select Committee (ya goofed on that part, ZDNet UK) copies of "The...

2 days ago by Alan Ralph via Facebook on MPs urge ISPs to take down terrorist material
Alan Ralph

In related news, the ISPs club together to get the members of the Home Affairs Select Committee (ya goofed on that part, ZDNet UK) copies of "The...

2 days ago by Alan Ralph via Facebook on MPs urge ISPs to take down terrorist material

Latest in Application Development