|
|
Cross-Browser Widgets
|
05/09/2009, by Peter Michaux
|
Building DHTML widgets for the general web is hard. By "general web", I mean the widget will be used on a web page that is accessible to any user with a web browser. The user may be physically disabled and using a screen reader. The web browser may be on a modern cell phone with archaic JavaScript support. Any combination of images, CSS, JavaScript in the browser may be turned off. The browser may be Internet Explorer. Building for the general web is building for 10000+ browser/operating system/configuration combinations. We cannot code specifically for each combination and we cannot test all the combinations. We must rely on state of the art practices:
- separation of concerns (i.e. HTML content, CSS presentation, JavaScript behavior)
- feature detection (i.e. not browser sniffing)
- progressively enhancements (a.k.a. graceful degradation)
The most difficult part of building a widget for the general web is coordinating the timing of all feature tests and DOM manipulation that need to happen when the page loads. An HTML page is rendered incrementally as it arrives. The page may be visible to the user at various stages of loading. We must ensure the page looks good at all points in the process for all visitors. Not every user will have the same experience when visiting the page. Some users will see widgets and others will see plain HTML if their browsers cannot support the widgets. Our goal is that all users will have a good experience by providing a pleasing visual and interactive page based on the browsers capabilities and by avoiding any JavaScript errors being thrown.
Unfortunately many front-end developers throw there hands up in frustration and convince the boss that "supporting a few recent versions of four (or three (or two)) modern browser with images, CSS and JavaScript turned on is good enough." Then they pull out the old navigator.userAgent (or a JavaScript library that uses it) and other hacks and before you know it their web page is broken for something like 15% of visitors. If the page is an purchase order form, that is a big loss in potential sales. It would have been better if the developers had just left the page as static HTML.
Read More...
|
Rate this Ajax News
Rating: 5.7 out of 6 votes cast
| |
|
|
| |
|
|
|
|
|
|
|
|