Firebug Tip: include() command
by Honza- Published:January 19th, 2013
- Comments:4 Comments
- Category:Firebug, Firebug Tip, Planet Mozilla
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.
See all Firebug tips
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!
4 Comments
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
Very nice tip that I never knew about, but like to see. Now to remember to use the aliased jquery.
[...] γ½γΌγΉ: Firebug Tip: include() command | Software is hard Β» [...]
@pd: Ha, that's a nice idea!
Also, thanks for your infinite support π
Honza