On 29/07/09 22:56, Laurakeet wrote:
> If I am using console.log for debugging locally do I need to make sure
> I remove those statements once I have pushed my code to a live web
> page? What if random users don't have firebug? Will it break my forms
> or other pages?
Yes, it will. You could use a DEBUG flag, like YaoXing suggested, or you
could add something like this to your scripts:
if (!("console" in window)) {
window.console = {
log: function () {}
};
}
This will allow you to keep the console.log statements in your code, if
you want, and browsers without a console object won't throw an error.
Stefan
--
LOAD"Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!",8,1
RUN!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---