Making Ajax Degrade Elegantly
The lessons in this book have covered the development of Ajax applications using various modern browsers. It is still possible, though, that a user might surprise you by attempting to use your application with a browser that is too old to support the necessary technologies. Alternatively, a visitor's browser may have JavaScript and/or ActiveX disabled (for security or other reasons).
It is unfortunate if an Ajax application should break down under these conditions.
At the least, the occurrence of obvious errors (such as a failure to create an instance of the XMLHTTPRequest object) should be reported to the user. If the Ajax application is so complex that it cannot be made to automatically revert to a non-Ajax mode of operation, perhaps the user can at least be redirected to a non-Ajax version of the application.
Tip
![]() | You can detect whether JavaScript is unavailable by using the <noscript> ... </noscript> tags in your HTML page. Statements between these tags are evaluated only if JavaScript is NOT available: <noscript> |