O'Reilly logo

YUI 3 Cookbook by Evan Goer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required