jquerymobile教程:[1]helloworld

2025-11-05 14:11:21

1、选择一款合适的IDE,如:Dreamweaver CS6、Visual Studio、Myeclipse2014等

这里笔者使用Myeclipse2014举例

jquerymobile教程:[1]helloworld

2、启动Myeclipse2014,选择新建html5 手机应用工程

jquerymobile教程:[1]helloworld

jquerymobile教程:[1]helloworld

3、新建html5 手机应用工程,命名--》选择jquery Mobile

完成

jquerymobile教程:[1]helloworld

jquerymobile教程:[1]helloworld

4、查看工程目录,在web app 开发时,重点关注下www目录

其中index.html是程序入口,js/css文件夹分别存放js和css文件(目前已有JQM需要的库文件)

jquerymobile教程:[1]helloworld

5、点开index.html,修改代码,例如:

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8"/>

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <meta name="description" content="A single-page template generated by MyEclipse Mobile Tools"/>

    <title>Single-Page Application</title>

    <link rel="stylesheet" href="./css/jquery.mobile-1.3.0.css"/>

    <script type="text/javascript" src="./js/jquery-1.8.3.js"></script>

    <script type="text/javascript" src="./js/jquery.mobile-1.3.0.js"></script>

    <link rel="stylesheet" href="css/style.css" />

</head>

<body>

    <div data-role="page">

        <div data-role="header" >

            <h1>Single-Page Application </h1>

        </div><!-- /header -->

        <div data-role="content" >

            <h1>Hello World</h1>

        </div><!-- /content -->

        <div data-role="footer" data-position="fixed" >

            <h4>Footer content</h4>

        </div><!-- /footer -->

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

</body>

</html>

6、选中工程,右击-》run as-》Mobile Web Simulator Application-》选择android启动

jquerymobile教程:[1]helloworld

jquerymobile教程:[1]helloworld

7、查看模拟器效果,如图

jquerymobile教程:[1]helloworld

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢