jquery Moblie Getting Started-hello World Sample Code Learning _jquery

Source: Internet
Author: User
Tags reserved
1. Need to run jquery MobileMobile Application page, you need to download jquery Mobile 3 related plug-in files (multiple versions), JQUERY.MOBILE-1.2.0.MIN.CSS, Jquery-1.8.3.min.js, Jquery.mobile-1.2.0.min.js,jquery Mobile official Address: http://jquerymobile.com
2, load the plug-in file into the page, pay attention to their loading order, statements such as
Copy Code code as follows:

<link href= "Css/jquery.mobile-1.2.0.min.css" rel= "Stylesheet" type= "Text/css"/>
<script src= "js/jquery-1.8.3.min.js" type "Text/javascript" ></script>
<script src= "Js/jquery.mobile-1.2.0.min.js" type= "Text/javascript" ></script>

3, Hello World sample code is as follows
Copy Code code as follows:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<meta name= "viewport" content= "width=device-width,initial-scale=1"/>// Set the width of the page to the same screen width as the mobile device
<link href= "css/jquery.mobile-1.2.0.min.css" rel= "Stylesheet" type= "Text/css"/>
& Lt;script src= "js/jquery-1.8.3.min.js" type "Text/javascript" ></script>
<script src= "js/" Jquery.mobile-1.2.0.min.js "type=" Text/javascript "></script>
</HEAD>
<BODY>
< Div id= "Page1" data-role= "page" >
<div data-role= "header" > <div data-role= "content" class= "content" ><p>hello world!</p></div>
<div data-role= "Footer" > </div>
</BODY>

4, since jquery Mobile has fully supported the HTML5 structure, the,<body> principal element code can also be modified to:
Copy Code code as follows:

<BODY>
<section id= "Page1" data-role= "page" >
<div data-role= "Content" class= "content" ><p>hello world!</p></div>
<footer data-role= "Footer" ></section>
</BODY>

5. To better browse jquery Mobile on the PC sideThe performance of the page in the mobile terminal, you can download Opera Mobile simulator, download address: http://cn.opera.com/, preview effect map:
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.