console.log is the most necessary debug tool for javascript ever, but it only works in FireFox with FireBug. Otherwise it gives you an error, could sabotage all of your other javascript. You could just comment them all out before releasing code. OR you can add a condition around it so that it only shows if it won’t error.
For security reasons you may want to comment out the console.logs anyways, but it doesnt hurt to apply this method to make sure it never produces an error.
if(typeof console.log == ‘function’){ console.log(‘your log string or object here’); }
Tags: JavaScript
This entry was posted
on Wednesday, May 27th, 2009 at 8:44 am and is filed under Uncategorized.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.






One comment
Leave a reply