Pragmatic Ajax Ajax UI, Part II
This PDF file contains pages extracted from Pragmatic Ajax. This chapter will present some of the standard techniques for utilizing Ajax on the UI. We’ll talk about validation, notification, and data management strategies that have proven they increase the utility and usability of web applications. Later, we’ll talk about some antipatterns, too, the things you should avoid and the tests you should apply when Ajaxifying your application. This chapter isn’t an exhaustive treatise. Our intent is to give you a set of foundational tools for deciding how to (and when not to) proceed.
…
Web applications face a variety of standard problems. Validation is one that has spawned an infinite array of potential solutions. We have learned over time that there is one universal delineation to be taken into account: the server side versus the client side. Or so we thought. Client-side validation is handy for our users because they get “instant” feedback about the correctness of their data entry without having to wait for the whole page to refresh. Client-side validation is largely useless to the application developer, however, since it is trivial for a user to circumvent client-side JavaScript. Heck, users can ignore our rendered HTML entirely and craft requests to our system using Telnet. Therefore, server-side validation is always mandatory. Client-side validation is a usability enhancement for our users.
Ajax allows us to combine the two techniques for greater usability. The problem with client-side techniques is that the validation rule itself has to be portable to the browser. This means you can execute regular expression matches, required field checking, and even small-scale data comparisons (for example, is the state abbreviation one of the standard 50 two-letter abbreviations?). You can’t, however, validate the inputs against your database or against any server-side resident data or rules. With Ajax, we get the benefits of client-side validation (”instant” feedback without a page refresh) but the power of server-side validation (comparison against server-resident data or rules).
…
Website: media.pragprog.com | Filesize: 651kb
No of Page(s): 19
Click here to download Pragmatic Ajax Ajax UI, Part II.
Related Tutorial
Tags: Ajax, Pragmatic, UI, Web
Comments
Leave a Reply