Book Image

PhoneGap 4 Mobile Application Development Cookbook

Book Image

PhoneGap 4 Mobile Application Development Cookbook

Overview of this book

Table of Contents (19 chapters)
PhoneGap 4 Mobile Application Development Cookbook
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

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,
         initial-scale=1, maximum-scale=1,
         minimum-scale=1, width=device-width;" />
      <meta http-equiv="Content-type" content="text/html; charset=utf-8">
      <title>XUI</title>
      <script type...