31 ms·
What's wrong with Firebug? I fail to find a better alternative for JS debugging.
by antichaos 16y ago
What's wrong with Firebug? I fail to find a better alternative for JS debugging.
- convel 16y agoChrome Dev Tools.
- Detrus 16y agoYea those have some fancy live JS editing capability, where you can edit the JS, it runs the code with the changes but without restarting the whole program. http://www.youtube.com/watch?v=TH7sJbyXHuk http://www.youtube.com/watch?v=TH7sJbyXHuk
- igrekel 16y agoLast time I used firebugs you couldn't really edit files in it, it was also missing many goodies for easily browsing code or code completion.
- hundredwatt 16y agoI have run into problems in the past caused by forgetting to remove console.log() lines from my scripts. If the console wasn't open, then the scripts didn't work. This isn't a huge problem or reason not to use Firebug (which I would be totally lost without), just something to be wary of.
- notauser 16y agoYou can solve(?) this by creating a dummy console.log object when one isn't already present, then throwing away all of the output.
- maxanger 16y agoif (window.console) console.log(...);
- jackowayed 16y agoThat really should be built in to console.log.
- geocar 16y agoif(!console)console={log:function(){}}; You're welcome.
- marcuswestin 16y agoThis will throw if console is not defined. Try if (!window.console) Or if (typeof console == 'undefined') Or if !('console' in window)) N
- geocar 16y agoDoesn't here. What are you using?
- toni 16y agoMy solution to this issue was to write a console2.log helper function and call that instead of the original console.log: var console2 = { log: function(msg){ if(typeof console != 'undefined'){ console.log(msg); } } }
- devpopol 16y agoif(!window.console){window.console = {};} if(!(toString(window.console.log) === '[object Function]')) {window.console.log = function(){};} there, fixed..
- jmtulloss 16y agoThis won't work in node. That's not a huge deal, but it's pretty simple to come up with a cleaner solution that works in all environments.