在jquery mobile中动态加载页面内容

时间:2015-05-06 11:02:56

标签: jquery jquery-mobile

如何操作对于使用动态页面加载的应用程序,应用程序仅启动并加载第一个屏幕。基于用户交互,可以通过检索新的HTML内容并在jquery移动中用它取代当前屏幕而不丢失其样式来显示新屏幕(如何在发生点击事件时在一个页面div中加载不同的页面内容)

页面名称是a.html

   <!DOCTYPE html>
<html>
<head>
  <!-- Include meta tag to ensure proper rendering and touch zooming -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Include jQuery Mobile stylesheets -->
  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
  <!-- Include the jQuery library -->
  <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
  <!-- Include the jQuery Mobile library -->
  <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>

<div data-role="page" id="pageone">
  <div data-role="header">
    <h1>Insert Page Title Here</h1>
  </div>

  <div data-role="main" class="ui-content" id="container">
    <p>Insert Content Here</p>
  </div>

  <div data-role="footer">
    <h1>Insert Footer Text Here</h1>
  </div>
</div> 

</body>
</html>

我想用不同的html页面中的其他内容更改内容(id =容器) 那是 页面名称b.html没有丢失jquery mobile的css样式

<div data-role="main" class="ui-content">
    <p>I Am Now A Mobile Developer!!</p>
  </div>

0 个答案:

没有答案
相关问题