I frequently do something like:

if(typeof window.console == 'undefined') window.console = { log: function()
{} };

So I can just use console.log() at will since if Firebug (or alternative) is
not present, it will just do nothing when called.

You can also extend that to do some kind of alternate logging if
console.logisn't defined.
E.g.,

if(typeof window.console == 'undefined') {
  window.console = {
    log: function(msg) { $('div#log').append('<p>'+ msg '</p>'); }
  }
}

A little less trouble than installing Firebug Lite, but not quite as nice.

Scott

On Thu, Feb 14, 2008 at 7:14 AM, spinnach <[EMAIL PROTECTED]> wrote:

>
> try
>
> if (window.console) {
>   console.log(...);
> }
>
> dennis.
>
> mtest wrote:
> >
> > Hello all :)
> > If it possible to define Firebug? Install it or not? Like it possible
> > do whis browsers by command:
> >
> > if ($.browser.safari) {
> >    alert("this is safari!");
> > }
> >
> > maybe like this :))
> >
> > if ($.extensions.firebug) {
> >    alert("FireBug is install!");
> > }
> >
> > Thank you to attention,
> > and one more time sorry for my poor english:), but I try hard :)
> >
>
>


-- 
--
Scott Trudeau
scott.trudeau AT gmail DOT com
http://sstrudeau.com/
AIM: sodthestreets

Reply via email to