By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,068 Members | 1,734 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,068 IT Pros & Developers. It's quick & easy.

How to write to Firefox's JavaScript console?

P: n/a
kj

How can a script send (non-fatal) warnings and other such messages
to Firefox's JavaScript console?

Thanks!

kj
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
Jan 2 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
kj wrote:
How can a script send (non-fatal) warnings and other such messages
to Firefox's JavaScript console?
I suggest you install the Firebug extension for Firefox:
https://addons.mozilla.org/firefox/1843/

Once you install, the Firefox javascript console replaces the built-in
javascript console. Then you can write to the Firebug console using
this syntax:
console.debug("hello world");
or to print the values of variables foo, bar and baz, you can use
printf syntax:
console.debug("First value is %s, second is %
s and the last is %s", foo, bar, baz);

The documentation for Firebug can be found here:
http://www.getfirebug.com/docs.html

Firebug has a rich debugging syntax, but also a JavaScript debugger(!)
and a DOM inspector.
I've found it to be a wildly useful development tool.

If you're interested in all that as well, here are a couple of links:
http://encytemedia.com/blog/articles...g-with-firebug
http://www.digitalmediaminute.com/sc...st/firebug-js/
>
Thanks!

kj
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
Jan 2 '07 #2

P: n/a
kj

Many thanks!

kj

In <11********************@a3g2000cwd.googlegroups.co m"Noah Sussman" <bl******@gmail.comwrites:
>kj wrote:
>How can a script send (non-fatal) warnings and other such messages
to Firefox's JavaScript console?
>I suggest you install the Firebug extension for Firefox:
https://addons.mozilla.org/firefox/1843/
>Once you install, the Firefox javascript console replaces the built-in
javascript console. Then you can write to the Firebug console using
this syntax:
console.debug("hello world");
or to print the values of variables foo, bar and baz, you can use
printf syntax:
console.debug("First value is %s, second is %
s and the last is %s", foo, bar, baz);
>The documentation for Firebug can be found here:
http://www.getfirebug.com/docs.html
>Firebug has a rich debugging syntax, but also a JavaScript debugger(!)
and a DOM inspector.
I've found it to be a wildly useful development tool.
>If you're interested in all that as well, here are a couple of links:
http://encytemedia.com/blog/articles...g-with-firebug
http://www.digitalmediaminute.com/sc...st/firebug-js/
>>
Thanks!

kj
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
Jan 3 '07 #3

P: n/a
kj <so***@987jk.com.invalidwrote in news:en**********@reader2.panix.com:
How can a script send (non-fatal) warnings and other such messages
to Firefox's JavaScript console?
Better yet, show warning, errors, debugging info, value of variables,
whatever, right on the page you're debugging, with fvlogger:

http://www.alistapart.com/articles/jslogging
Jan 3 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.