Installing the XUI framework (iPhone JavaScript)

Frameworks and libraries such as jQuery, prototype, MooTools, YUI, and Dojo are becoming very popular among web developers. All of them present an easy way for using the DOM model of HTML in addition to the AJAX capabilities and other interesting features such as animations, including support for multiple browsers avoiding the complexity of cross-browser applications. It sounds pretty good but the problem is that they aren’t focused on mobile devices. To solve this problem we’re introducing XUI, a simple but powerful and lightweight JavaScript framework.

Getting ready

XUI is open source and can be downloaded from the main page of its website (http://xuijs.com/). As seen in the previous recipes, you will need a web browser or a command-line utility for downloading. Developers or people interested in development versions will need a client for it, the version control system used by the XUI open source project.

How to do it…

Open your web browser and type this URL: http://xuijs.com/downloads/.

In the list, we’ll find different versions related to the general mobile devices and specific for BlackBerry and Windows Mobile operating systems. Each version has two different files, one minified and the other commented. The first one should be used for production environments. We’ll download the commented version for general mobile devices, marked as webkit/firefox/opera. After clicking on the specified link, you’ll have a new file called xui-2.0.0.js. If you prefer to use command line, you can execute the following command:


tmp1A15_thumb

 

tmp1A16_thumb

The last step will be to copy these files to a folder inside our DocumentRoot directory. For example, on Fedora Linux:

tmp1A17_thumb

How it works…

XUI is a pure JavaScript framework integrated only by files written in this programming language. In order to use this lightweight and fast framework, we only need to copy the two JavaScript files into a folder with permissions for our web server, and then include a reference on the HTML files of our web application for iPhone.

Inside the head section of our HTML files, we’ll need to add this line:

tmp1A18_thumb

A complete reference and documentation for the XUI framework can be found at: http://xuijs.com/docs.

All the source code for the XUI can be found at http://github.com/ xui/xui.

A complete reference and documentation for the XUI framework can be found at: http://xuijs.com/docs.

All the source code for the XUI can be found at http://github.com/ xui/xui.

Next post:

Previous post: