このjavascriptを使用して、あるhtmlページを別のhtmlページにロードしようとしています
$('.myajax').click(function() {
var myhref=$(this).attr('href');
$('#contentdiv').hide().load(myhref).fadeIn('slow');
return false;
});
という名前の div に Google マップを読み込もうとすると、常に問題が発生しますcontentdiv
。そうしようとすると、ブラウザには何も表示されません。完全に空白になります。Google マップを含むページは次のようになります。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps Geocoding Demo</title>
<script src="http://maps.google.com/maps/api/js?sensor=false"
type="text/javascript"></script>
</head>
<body>
<div id="map" style="width: 400px; height: 300px;"></div>
<script type="text/javascript">
var address = 'London,UK';
var map = new google.maps.Map(document.getElementById('map'), {
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoom: 6
});
var geocoder = new google.maps.Geocoder();
geocoder.geocode({
'address': address
},
function(results, status) {
if(status == google.maps.GeocoderStatus.OK) {
new google.maps.Marker({
position: results[0].geometry.location,
map: map
});
map.setCenter(results[0].geometry.location);
}
else {
// Google couldn't geocode this request. Handle appropriately.
}
});
</script>
</body>
</html>
誰かがエラーを指摘できますか??