[jQuery] Re: How to define FireBug?

2008-02-14 Thread Karl Swedberg


Also, if it's really Firebug that you're after, and not just the  
console, you could do this:


  if (window.console && console.firebug) {
console.log("Firebug is installed");
  }


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Feb 14, 2008, at 7:14 AM, spinnach 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 :)






[jQuery] Re: How to define FireBug?

2008-02-14 Thread Scott Trudeau
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(''+ msg ''); }
  }
}

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


[jQuery] Re: How to define FireBug?

2008-02-14 Thread spinnach


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 :)