当用户按下链接时,我试图将页面加载到 div 中。但是在开发控制台(Chrome)中,我收到以下错误:
Uncaught TypeError: undefined is not a function
(anonymous function)
我的 HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="CSS/common.css" />
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.8.2/dojo/dojo.js" data-dojo-config="async:true, parseOnLoad:true"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="JS/common.js"></script>
<script src="JS/DyContent.js"></script>
<title></title>
</head>
<body>
<div id="bannerColor"></div>
<div id="imgNav">
<img id="banner" src="Images/logoLast.jpg"/>
<ul id="nav">
<li class="current"><a "View/index.php">Home</a></li>
<li><a href="#About">About Us</a></li>
<li><a href="#Login">Login/Register</a>
<ul>
<li><a href="#Add">Add/Remove Car</a></li>
<li><a href="#Search">Serach Invoices</a></li>
<li><a href="#Book">Book Service</a></li>
</ul>
</li>
<li><a href="#Gallery">Gallery</a></li>
<li><a href="#Contact" id="Contact">Contact Us</a></li>
</ul>
</div>
<div id="centerPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'"></div>
</body>
</html>
我的 JQuery 文件:
$(document).ready(function () {
$('#Contact').click(function () {
$('#centerPane').load('External/map.php');
});
});
和我试图加载的页面(map.php):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="/CSS/common.css" />
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="/JS/location.js"></script>
<title></title>
</head>
<body>
<header></header>
<div id="mapContainer"></div>
<div id="writtenDir"></div>
<footer></footer>
</body>
</html>
是什么导致错误并且不允许填充 div?
编辑:
<link rel="stylesheet" type="text/css" href="http://scmweb.infj.ulst.ac.uk/~B00518833/DNA/View/CSS/common.css" />
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="http://scmweb.infj.ulst.ac.uk/~B00518833/DNA/View/JS/location.js"></script>
<div id="mapContainer"></div>
<div id="writtenDir"></div>