Debug JavaScript? Using Eclipse?

I mentioned earlier that I have been working with the Eclipse Ajax Toolkit Framework (ATF). Before today, my experience with JavaScript has been limited, and generally involved a lot of screaming in frustration. This afternoon, I spent some time with the ATF JavaScript debugger.

The best part is that the JavaScript debugger looks a heck of a lot like the Java debugger. There’s a good reason for this, as the same debugging infrastructure is leveraged by both. If you’re familiar with Java debugging in Eclipse, JavaScript debugging is a breeze. It starts by right-clicking on your file and selecting “Debug As > Debug in Mozilla” from the pop-up menu.

In the diagram, you see the standard “Debug” and “Variables” views while debugging my lame Fibonacci number calculation example. At this point, we’re a few levels into the recursion as evidenced by the depth of the stack in the “Debug” view. Variable values for the highlighted frame are displayed (as expected) in the “Variables” view. The “Step Into”, “Step Over”, “Step Return”, “Resume”, and “Terminate” buttons all work as expected.

Now that I have a JavaScript debugger, it’s time for me to start doing some actual Ajax stuff…

This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Debug JavaScript? Using Eclipse?

  1. betto says:

    it’s good to know about ATF and javascript debugging!Thanks!🙂

  2. Werner says:

    Wayne, is ATF and its dependencies available as Local Update Site?
    We’re behind a strict firewall and proxy that doesn’t allow us to use update sites, so only local ones work. I already tested JSDT, which works great for static pages, but fails to run dynamic web apps, especially on WebLogic. Hope, ATF may work better here ?:-|
    TIA,
    Werner

  3. Wayne Beaton says:

    @Werner, this is a question that is better asked (and answered) on the project forum. http://eclipse.org/forums/eclipse.tools.atf

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s