Home arrow JavaScript arrow Exception Handling in JavaScript: Addressing Browser Incompatibilities
JAVASCRIPT

Exception Handling in JavaScript: Addressing Browser Incompatibilities


Not all browsers handle all code the same way. Differences can be addressed with JavaScript exceptions. These may not be the best way under all circumstances, but you'll find it worthwhile to examine this approach.

Author Info:
By: Alejandro Gervasio
Rating: 4 stars4 stars4 stars4 stars4 stars / 6
October 11, 2005
TABLE OF CONTENTS:
  1. · Exception Handling in JavaScript: Addressing Browser Incompatibilities
  2. · JavaScript-based http requests: implementing cross-browser object instantiation
  3. · Cross-browser object instantiation: browser detection through exceptions
  4. · Proprietary event handlers: implementing browser-independent event handling
  5. · Assigning events to objects: using exceptions to manipulate event handlers

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Exception Handling in JavaScript: Addressing Browser Incompatibilities
(Page 1 of 5 )

Introduction

Welcome to the last part of the series “Exception Handling in JavaScript.” As you might guess, I’m winding up this tutorial focused on exploring the huge terrain of JavaScript exceptions, by running through numerous examples about their application in real client programs. Indeed, the topic is by far more extensive than can be treated in a few articles, thus complete coverage is nearly impossible. However, I’ve explained in a friendly way the basics of exceptions, by introducing their core concepts as well as their direct implementation in concrete cases.

With reference to a practical application, in my previous article I offered an introduction to using custom error objects in a classic situation -- client-side form validation -- by tackling the issue from a different point of view, certainly distinct from traditional form verification techniques. Whether you use JavaScript as part of overall data validation processes (remember that server-side checking is a must), or simply for adding pre-defined behaviors to the structure of web documents, exceptions can be used to handle errors in a more professional way, by utilizing popular “try-catch” blocks.

Since most of the examples that I’ve shown through this series are aimed at providing you with the required background to use exceptions in practical cases, over this last part I’ll continue sticking to that approach by demonstrating particularly how some browser incompatibilities can be addressed with exceptions. Of course, I’m not claiming this method is the best way to deal with all browser inconsistencies, but certainly it does offer an alternative method that’s worth reviewing.

Now that you know what this last part of the series is about, let’s see a few examples that use exceptions for solving some browser-related incompatibilities.


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks
- Dynamic jQuery Styling

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials