I have the following:
console.log (a.time_ago() + ' ' + b.time_ago());
This is breaking in FireFox 3, meaning when FF hits that line in the JS, it goes no further. Strangely if I have Firebug open it doesn't break and continues as normal. Some how firebug prevents this issue?
I'm puzzled on this one. Any thoughts as to why console.log would break firefox 3, but not if firebug is open?
Thanks
This is not just Firefox. Your code will stop working in every browser (except Chrome and safari (in some instances) because they have console.log() built in along with their developer tools.)
It is because when you don't have firebug open, the object "console" is not defined. You should take care never too leave console.log() functions in your code, or it will break in every browser.
I'd like to add that I have sometimes used this function:
Then you can simply call:
and it will work the same way as console.log, but will not fail if firebug is not loaded (and is shorter to type :P)
Cheers