Pages

Friday, May 17, 2013

For more understandable error reporting, use the JavaScript console in Gecko-based browsers

When you encounter JavaScript errors in Internet Explorer, they'll be in your face (as long as you select the Display A Notification About Every Script Error check box which is located in the Browsing section on the Advanced tab under Tools | Internet Options). That's good for catching them in the first place (in Netscape, you might never notice the errors). However, when it comes to figuring out what the error is, Netscape beats IE in spades. Case in point: IE gives you messages such as "Expected identifier" and "Object expected." So, what's wrong with the code? How do you fix it? Who knows?

Compare this with what we see when we open the same error-ridden file in Netscape Navigator or Mozilla and navigate to Tools | Web Development | JavaScript Console. The messages say things like "missing variable name." There's nothing like good 'ole English! And certain error messages even show pictures of your code with an arrow pointing to exactly the character that's incorrect. What's more, instead of a flurry of confusing dialogue boxes, you see the errors in order. That makes it much easier to figure out what's wrong.



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.