Debugging Javascript
If you've ever tried to debug Javascript you know how frustrating it can be. You've got the alert function you can call, but it's pretty brain-dead and if you pass it an Array or Object it can't show any of the content. Firefox offers some useful Javascript errors when they occur, and IE is just about useless in giving you any clue as to what's going on.
If you want to make your Javascript debugging a LOT easier, you need to get the Firebug plug-in for Firefox. While it does have some problems (it slows down pages and occasionally crashes), it makes debugging much, much easier. And you can turn Firebug on and off with a single click, so it's easy to turn on when you need it.
It gives you code profiling, timing, breakpoints, and all sorts of complicated functionality. But even if you are an old-school type who likes to print alerts, it makes that better too. Using the console logging (instead of alerts), you can print out the values and keys for arrays and objects. Even more powerfully, you can type javascript directly into the console and have it execute on the page. This allows you to do things like test out regular expressions and perform DOM manipulation directly on your page. Very simple to do, and very powerful. Your javascript development will be a lot faster and much less frustrating.
If you want to make your Javascript debugging a LOT easier, you need to get the Firebug plug-in for Firefox. While it does have some problems (it slows down pages and occasionally crashes), it makes debugging much, much easier. And you can turn Firebug on and off with a single click, so it's easy to turn on when you need it.
It gives you code profiling, timing, breakpoints, and all sorts of complicated functionality. But even if you are an old-school type who likes to print alerts, it makes that better too. Using the console logging (instead of alerts), you can print out the values and keys for arrays and objects. Even more powerfully, you can type javascript directly into the console and have it execute on the page. This allows you to do things like test out regular expressions and perform DOM manipulation directly on your page. Very simple to do, and very powerful. Your javascript development will be a lot faster and much less frustrating.
| Link: | addons.mozilla.org...Search for more tips related to this link |
| Rating: | 100% positive, 1 Vote |
| Categories: | programming javascript debugging firefox firebug |
| Added: | on Sep 12, 2008 at 2:35 pm |
| Added By: | an anonymous user |

