Command Line API in Firebug

Long time since I have made a  post. This time it is on one of my fav web development tool Firebug. It has got a cool command line API console for writing JavaScript commands that can be executed on the fly. This is particularly important when we debug large JavaScript code. We need to reload the js file each time after making any changes – which can be quite time consuming. Here is where command lines can be of great help.

There are two type of Command lines API:-

  1. One Line Command Line – This is the default command line. We can write a single line of JavaScript code here. Also it supports auto complete feature (i.e by hitting the tab key you can complete your js code just like other well known editors). After writing your code press enter. The code gets executed and you can see the execution details under the  console window. See highlighted area below.

2. Multi Lines Command Line – Here we can write and excute multipe lines of code on the fly. Write your js code and click Run button. The code gets excuted and you can see the execution details under the  console window. Firebug also provides a list of APIs to access the DOM element as well as to monitor and profile the javascript code that is getting executed. Typing these in the command line and executing helps us to  see what is the value of an HTML element,whether a function has been executed or not etc.

Firebug as always Roxx..  🙂

Advertisements

3 Comments (+add yours?)

  1. sooraj
    Nov 18, 2010 @ 08:11:26

    Good tip manmu, it will save js debugging, thanx…

    Reply

  2. Ansar
    Jun 15, 2011 @ 09:31:16

    Good Post

    Reply

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

%d bloggers like this: