Search This Blog


Thursday, June 18, 2009


After ditching Firefox in favor of Google Chrome, I am drawn towards Firefox, once again.

No, I am not going back to use Firefox as my browsing browser; I am using Firefox as my Javascript development.

Unlike server-side language ( whether it's a compiled or scripting language), the development for client-side language is often a pain to write. I remember I spent a lot of times sharing at the Javascript code, unable to figure out the error. Of course, the inline function syntax doesn't help, too.

Javascript can be hard to write, and even harder to read. Take the below for example, see how many of you can identify the error:
  test("getPersons", function() {

            function(response) {

                persons = $.evalJSON(response.d);                
                equals(persons[0].FirstName, "Mohammad");

function getPersons(callback) {

    var persons = null;


        type: "POST",
        dataType: "json",
        data: "{}",
        contentType: "application/json",
        url: "ViewRecord/GetPersons",
        success: function(response) {            


The answer is... you don't know until you run the code ( The answer can be found here). And this is when FireBug comes into handy. You can view the error right in the Console window:

No second guessing, no "alert" everywhere to find the error. The problem is exposed, right in front of you. And if you still can't find it you should change a pair of glass.

As browsers innovate at a furious pace, and as Javascript is going to play more and more roles in web application development, tools like Firebug is invaluable.

The only puzzle is, why is it so hard for IE, Google Chrome and Safari to come out with their own debugging tools?

No comments: