Create web applications in Dreamweaver for mobiles

Dreamweaver’s integration with jQuery Mobile helps you quickly design a web application that works on most mobile devices while adapting itself to the dimensions of the device.

Creating a web application using jQuery Mobile

Open a jQuery Mobile starter page, or create a HTML5 page

Use the jQuery Mobile starter pages in Dreamweaver to create your application. Alternatively, you can start creating your web application with a new HTML5 page.

The jQuery Mobile starter pages include the HTML, CSS, JavaScript, and image files that help you get started with designing your application. You can use the CSS and JavaScript files hosted on a CDN, your own server, or files installed along with Dreamweaver.

Opomba:

To identify the location of the linked files, see the <link> and <script src> tags in code view.

Insert jQuery Mobile components from the Insert panel

Insert jQuery Mobile components from the Insert panel into the HTML page. The jQuery Mobile CSS and JavaScript files define the style and behavior of the components.

About CDNs and local jQuery Mobile files

CDNs

A CDN (content delivery network) is a computer network containing copies of data placed at various points in the network. When you create a web application using the URL for a CDN, the CSS and JavaScript files specified in the URL are used for your application. By default, Dreamweaver uses the jQuery Mobile CDN.

Alternatively, you can use URLs of CDNs from other sites such as Microsoft and Google. In code view, edit the server location of the CSS and JavaScript files specified in the <link> and <script src> tags.

The files downloaded from a CDN are read-only.

Local jQuery Mobile files

When you install Dreamweaver, a copy of the jQuery Mobile files is copied to your computer. The HTML page that opens when you choose the jQuery Mobile (local) starter page is linked to local CSS, JavaScript, and image files.

Starter pages for jQuery Mobile

Dreamweaver provides you with the following starter pages to create your web application:

jQuery Mobile (CDN)

Use this starter page if you plan to host the jQuery Mobile library on a CDN.

 

jQuery Mobile (Local)

Use this starter page if you plan to host the assets yourself, or if your application doesn’t rely on an Internet connection.

 

jQuery Mobile (PhoneGap)

Use this starter page if your web application, when deployed as a mobile application, accesses features native to mobile devices. For more information, see Packaging web applications.

 

 

Use starter pages to create an application for mobile devices

  1. Select File > New.

  2. Select one of the following based on your requirement:

    • Page From Sample > Mobile Starters > jQuery Mobile (CDN).

    • Page From Sample > Mobile Starters > jQuery Mobile (Local).

     

  3. Click Create.

    In the page that appears, enable Follow Links Continuously (View > Live View Options), and switch to Live View. Use the navigation components to test how the application works.

    Use the options in the Multiscreen menu to see how the design is displayed in devices with various dimensions. Disable Live view, and switch back to the Design view.

  4. In the Insert panel (Window > Insert), select jQuery Mobile. The components that you can add to the web application are displayed.

  5. In Design view, place the cursor at the location where you want to insert the component, and click the component in the Insert Panel. In the dialog box that appears, customize the components using the options.

  6. (jQuery Mobile - Local) After you save the HTML file, the jQuery Mobile files, including image files, are copied to a folder in the HTML file location.

Preview the page in Live view. Some of the CSS classes are applied only in the Live view.

Create a web application for mobile devices from a new page

The Page component acts as the container for all the other jQuery Mobile components. Add the Page component before you proceed to insert other components.

  1. Select File > New.

  2. Select Blank Page > HTML.

    Some of the jQuery Mobile components use HTML5-specific attributes. To ensure HTML5 compliance during validation, ensure that you select HTML5 as your DocType.

  3. In the Insert panel (Window > Insert), select jQuery Mobile from the menu. The jQuery Mobile components appear in the panel.

  4. From the Insert panel, drag the Page component to Design view.

  5. In the jQuery Mobile Files dialog, select one of the following:

    Remote (CDN)

    If you want to connect to a remote CDN server hosting the jQuery Mobile files. Use the default option for the jQuery site if you have not configured a site containing jQuery Mobile files. You can also choose to use other CDN servers.

    Local

    The files that are available in Dreamweaver are displayed. To specify a different folder, click Browse, and navigate to the folder containing the jQuery Mobile files.

    The CSS and JavaScript files are copied to a local temp directory until you save the HTML file to your computer. After you save the HTML file, all associated jQuery Mobile and image files are copied to a folder in the site’s root folder.

  6. Enter the properties for the Page component.

  7. In Design view, place the cursor at the location where you want to insert the component, and click the component in the Insert Panel. In the dialog box that appears, customize the components using the options.

Preview the page in Live view. Some of the CSS classes are applied only in the Live view.

Using custom files and folders

You can choose to create custom CSS and JS files for your application. Ensure that your files are named jquery.mobile.js, jquery.mobile.css, and jquery.js

If you are using custom folders, do the following:

  1. Download the uncompressed version of the jQuery 1.5 core library from http://docs.jquery.com/Downloading_jQuery#Download_jQuery.

  2. Save the file to the core folder containing the other resources.