Chapter 11. Universal Access

The main reason to build a web application in the first place is to make it widely available.

In one sense, “widely available” can mean “cross-platform support.” Here, YUI breaks from current fashion—rather than creating a variant “Server Edition” or “Mobile Edition” of the library, YUI leverages its façade APIs and the YUI Loader to abstract away the differences between very different platforms. Whether in an old or new browser, whether in a mobile phone, a tablet, a laptop, or on Node.js, YUI uses the same basic strategies to present a uniform interface:

  • Where there are bugs and missing features, YUI silently fills in the gaps and presents the same interface.

  • Where necessary, YUI uses conditional loading to deliver exactly the right code to the right device.

  • Where there are fundamental platform differences (such as gestures versus mouse actions, or using YUI Loader on the server), YUI provides abstractions that enable you to write cross-platform code.

However, “widely available” means more than just running in different environments. Web applications should be accessible to users who rely on assistive technology such as screenreaders. Web applications should also serve users around the world, reflecting the user’s native language, locale, and other preferences.

Unfortunately, YUI can’t abstract away differences between English and French the way it can abstract away differences between Firefox on Windows and Safari on iOS. What YUI can do is offer ...

Get YUI 3 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.