JavaScript was around prior to HTML5; however, the elements that can be triggered using JavaScript have improved greatly due to the new properties within CSS3. Numerous JavaScript libraries or frameworks help you program faster and easier. Most JavaScript libraries are not formatted for mobile, meaning that they have tons of code for cross-browser capability, such as IE6, that won’t be necessary when developing for mobile. The larger a file size, the slower your application will load. It is best to use a library that fits your needs but doesn’t come with a lot of extra overhead.


jQuery is one of the most popular JavaScript frameworks on the web. It contains simple methods that help you implement complicated CSS3 functions, such as CSS3-Rotate, CSS3-Animations, and more. The downside to this library is that it is 31KB. Although that may appear small, there are a lot of references to IE6 code in this script that you never use for mobile development. This can create slower load times when loading the application for the first time.


XUI is an up and coming JavaScript framework, built by Brian Leroux (a member of the development team for PhoneGap). The goal of this project is create a simple-to-use framework that has syntax similar to jQuery’s, but has a smaller footprint for mobile devices. Compared to the 31KB file size of jQuery, XUI is 4.2KB and contains most of the same features of jQuery. If you are looking for similar syntax and a smaller set of features ...

Get Smashing Mobile Web Development now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.