我正在尝试将第B页的内容读到第A页。
页面A包含页眉,内容和页脚,我只想更改内容div。
因此,在页面A中,我有以下代码:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Website</title>
<link rel="stylesheet" href="css/jquery.mobile-1.3.2.min.css" />
<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div data-role="page" id="mainpage">
<div data-role="panel" id="leftPanel">
<ul data-role="listview" data-theme="b" data-divider-theme="c">
<li><a href="#" id="services">Services</a></li>
</ul>
</div>
<div data-role="header" data-theme="b">
<h1>News</h1>
</div>
<div data-role="content" id="content">
<ul data-role="listview" data-inset="true">
<li>Testing A</li>
</ul>
</div>
<div data-role="footer" data-position="fixed" data-fullscreen="true">
<h1>Footer</h1>
</div>
</div>
</body>
<script type="text/javascript">
$("#services").click( function () {
$('#content').load('services.php #contentindex');
});
</script>
</html>
在页面B(即services.php)中,我有:
<html><head>
<body>
<div id="contentindex">
<ul>
<li>Lets go people!</li>
</ul>
</div>
</body>
</head>
</html>
所以,我有两个问题:
谢谢你们。