div (전폭), 왼쪽 메뉴 (200px) 및 오른쪽 내용 (600px)이 포함 된 매우 간단한 웹 사이트가 있습니다. 클릭 할 때 오른쪽 내용을로드하는 간단한 jquery 스크립트를 사용하는 다섯 개의 메뉴 항목이 있습니다. 모든 것이 잘 열리지 않는 구글지도를 제외하고는 잘 작동합니다. localhost/contact.html로 이동하면 기능이 제대로로드됩니다. 그것은 단지 전체 문서/html에 포함되는 것을 좋아하지 않습니다. 메뉴에 대한Google지도를 특정 div에 표시하는 중
코드 :
$(document).ready(function() {
$("#about").on("click", function() {
$("#content").load("about-us.html");
});
$("#candidate").on("click", function() {
$("#content").load("candidate.html");
});
$("#client").on("click", function() {
$("#content").load("client.html");
});
$("#meet").on("click", function() {
$("#content").load("meet.html");
});
$("#contact").on("click", function() {
$("#content").load("contact.html");
});
});
코드 contact.html
<body>
<script type="text/javascript" src="js/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
var myCenter = new google.maps.LatLng(51.510252,-0.086585);
function initialize()
{
var mapProp = {
center: myCenter,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
var marker = new google.maps.Marker({
position: myCenter,
animation:google.maps.Animation.BOUNCE
});
marker.setMap(map);
}
</script>
<table border="3px">
<tr><td align="right">
t: <br>
1st Floor<br>
Regis House<br>
45 King William Street<br>
London, EC4R 9AN
</td>
<td id="googleMap" width="300px" height="300px">
</td>
</tr>
</table>
<script type="text/javascript">initialize('googleMap');</script>
</body>
에 대한 그냥 크롬 킁킁이 오류를보고 :
Uncaught ReferenceError: google is not defined VM500:1
(anonymous function) VM500:1
o.extend.globalEval jquery-2.1.0.min.js:2
o.fn.extend.domManip jquery-2.1.0.min.js:3
o.fn.extend.append jquery-2.1.0.min.js:3
(anonymous function) jquery-2.1.0.min.js:3
o.access jquery-2.1.0.min.js:2
o.fn.extend.html jquery-2.1.0.min.js:3
(anonymous function) jquery-2.1.0.min.js:4
j jquery-2.1.0.min.js:2
k.fireWith jquery-2.1.0.min.js:2
x jquery-2.1.0.min.js:4
(anonymous function)
질문에 더 많은 정보를 추가해야합니다. 여기 (http://jsfiddle.net/PdcE9/) Google지도가 작동합니다. – Praveen