O'Reilly logo

PhoneGap 4 Mobile Application Development Cookbook by Zainul Setyo Pamungkas

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

Learning the basics of the library

When creating applications that focus as heavily on user interactions as mobile apps do, we want to be able to easily update and manage the underlying HTML and data collections.

How to do it...

We'll make use of XUI's simple but powerful DOM traversal methods and the ability to extend the library functionality to custom code:

  1. Create the basic layout for the HTML page.
  2. Create a div element within the page with some text. In this case, we're going to create a Hello World sample text. Set the id attribute for this element to content.
  3. Include a new script tag in the head tag of your document, and reference the XUI library within your project directory:
    <!DOCTYPE HTML> <html> <head> <meta name="viewport" content="user-scalable=no, ...

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