我通过Ajax加载不同的页面来替换母版页中的DIV(" myPage")的内容,但是我得到了#34;错误加载页面"每次单击页脚链接加载页面。代码有什么问题吗?
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.4.5.min.js"></script>
$(document).ready(function(){
$("#chat").click(function(){
$('#myPage').load('./chat.html');
$('#title').load('./constants.html #chat');
})
$("#address").click(function()
{
$('#myPage').load('./address.html');
$('#title').load('./constants.html #address');
})
})
</script>
<div data-role="header" data-position="fixed" data-theme="b">
<h1 id="title"></h1>
</div>
<div id="myPage" data-role="content"></div>
<div data-role="footer" class="nav-custom" style="overflow:hidden;" id="myFooter" data-theme="b" data-position="fixed" >
<div data-role="navbar" class="nav-custom" >
<ul>
<li><a href="function()" id="chat" data-icon="custom">Chat</a></li>
<li><a href="function()" id="address" data-icon="custom">Address</a></li>
</ul>
</div>
</div>