javascript - Why is Firefox 3 breaking with console.log -


i have following:

console.log (a.time_ago() + ' ' + b.time_ago()); 

this breaking in firefox 3, meaning when ff hits line in js, goes no further. strangely if have firebug open doesn't break , continues normal. how firebug prevents issue?

i'm puzzled on one. thoughts why console.log break firefox 3, not if firebug open?

thanks

this not firefox. code stop working in every browser (except chrome , safari (in instances) because have console.log() built in along developer tools.)

it because when don't have firebug open, object "console" not defined. should take care never leave console.log() functions in code, or break in every browser.


i'd add have used function:

function log () {     if (typeof console == 'undefined') {         return;     }     console.log.apply(console, arguments); } 

then can call:

log(somevar, anothervar); 

and work same way console.log, not fail if firebug not loaded (and shorter type :p)

cheers


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -