jQuery Mobile – The Data Attributes

The jQuery Mobile framework uses HTML5 data- attributes to apply a touch-friendly aesthetic to the user interface on mobile devices.

The basic structure of an app using the jQuery Mobile framework  can be as follows:

<div data-role="page" id="page1">

   <div data-role="header">
   </div> <!-- header -->

   <div data-role="main" class="ui-content">
   </div> <!-- main -->

   <div data-role="footer" id="footer">
   </div> <!-- footer -->

</div> <!-- page -->

Using jQuery Mobile

To use the jQuery Mobile framework in your web application, insert the following lines between the <head></head> tags of your index.html file as shown below:

 <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

Please note that the latest stable version of jQuery Mobile as of this writing was 1.4.5.

PhoneGap – Basic App Template

The HTML file (index.html) generated by the PhoneGap CLI when you create a new application project using the basic app template is as follows:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
        <title>Blank App</title>
    </head>
    <body>
        <script type="text/javascript" src="cordova.js"></script>
    </body>
</html>