Subscribe to RSS Feed

Firebug Command Line is probably one of the most important Firebug features and its value is yet extended by set of built-in commands.

One of the new commands, introduced in Firebug 1.11 is include() and this post is intended to explain how to use it and make your development more effective.

Firebug Commands

Before we start with include() command let's take a look at quick summary of all Firebug built-in commands.

help
$(id)
$$(selector)
$x(xpath)
$0
$1
$n(index)
dir(object)
dirxml(node)
cd(window)
clear()
copy(object)
inspect(object)
keys(object)
values(object)
include(url)
debug(fn)
undebug(fn)
monitor(fn)
unmonitor(fn)
monitorEvents(object)
unmonitorEvents(object)
profile([title])
profileEnd()
table(data[, columns])
traceCalls(fn)
untraceCalls(fn)
traceAll()
untraceAll()

Did you know all of them? See Firebug wiki for more details.

Now learn about include()

Include Remote Script

The basic purpose of include() command is to include a remote script into the current page.

include("http://code.jquery.com/jquery-latest.min.js")

In this particular example we included jQuery script and effectively jQuerified the page.

Create Alias

It would be irritating to type long URLs (and remember them) every time you reload the page and so, it's possible to create an alias.

include("http://code.jquery.com/jquery-latest.min.js", "jquery")

Now, all you need to do to include jQuery on your page is type:

include("jquery")

Aliases are persistent across Firefox restarts and list of existing aliases can be displayed by typing:

include();

To remove an existing alias type:

include(null, "jquery");

See also Firebug wiki for include() command.

Do you want to have more built-in commands in Firebug's Command Line? Just leave a comment and we can discuss it!


Rss Commenti

4 Comments

  1. I would like to see a thankyou() command. the command would send a massive thank you ecard to everyone involved in the firebug project πŸ™‚

    you all deserve so much credit for what is still the best developer tool ever written. life without firebug was and would be, hell

    #1 pd
  2. Very nice tip that I never knew about, but like to see. Now to remember to use the aliased jquery.

    #2 Michael Beckwith
  3. [...] γ‚½γƒΌγ‚Ή: Firebug Tip: include() command | Software is hard Β» [...]

    #3 Firebug Tip: include() command | Software is hard - γ‘γ‚…γ©γ‚“ι“δΈ­θ¨˜
  4. @pd: Ha, that's a nice idea!
    Also, thanks for your infinite support πŸ™‚
    Honza

    #4 Honza

Sorry, the comment form is closed at this time.