Cover by Maximiliano Firtman

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Chapter 12. JavaScript Mobile

Designing for the Web is about more than content and presentation—users expect websites to be interactive, responding to their choices. Fortunately, although it has some limitations, the JavaScript you use in developing for the mobile web is similar to that used in desktop web development.

We have already talked a bit about the WAP 1.1 standard scripting language, WMLScript. Don’t worry, we won’t go any deeper into this obsolete language.

Thankfully, a couple of years after this standard was released, mobile browsers started to add some support for JavaScript (or ECMAScript, to be totally correct). The standards for mobile scripting are more difficult to define than the standards for CSS. The great benefit is that, excepting some bugs, JavaScript can check at runtime whether some feature, object, or API is available, so we can code for different “standards.”

Note

The standard name for JavaScript is ECMAScript, because it is defined by the ECMA (an international, private nonprofit standards organization). There are three well-known dialects on the market: JavaScript (trademark of Oracle, licensed now to the Mozilla Foundation), ActionScript (trademark of Adobe), and JScript (trademark of Microsoft). At the base, they are the same language, and everyone adds new behavior. As Mozilla is leaving the name for free, it’s common that everyone -including Microsoft- uses JavaScript as the language name.

The only mobile-specific standard is called ECMAScript Mobile ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required