0

我们需要在 JQueryMobile 开发的移动网站的每个 html 页面中包含 CSS 和 JS 文件吗?

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

我认为它不在文档中,或者我只是错过了它。

4

1 回答 1

0

您应该有一个 html 文档,其中包含<div data-role="page">应用程序中所需的每个页面。查看多页模板的源代码。

<html>

   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1"> 
     <title>Multi-page template</title> 

     <!-- CSS and JS files here-->
     <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
     <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
     <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js">/script>
   </head> 


   <body> 

     <div data-role="page" id="first">
       <!-- Code for your first page -->
     </div>

     <div data-role="page" id="second">
       <!-- Code for your second page -->
     </div>

  </body>
</html>
于 2012-11-29T08:08:43.483 回答