誰かが私がここで間違っていることを説明できますか?私はjQuery$.getJSONとGoogleマップを使用しています。どちらも初心者です。もともと私は標準のJavaScriptを使用していましたが、XMLHttpRequestがChromeまたはjsfiddle内で機能していなかったため、jQueryを使用することにしました。また、。$ getJSONを使用してこれらの問題について心配する必要はないことを理解していますが、今は再構築する必要があります。 jQueryで正しく動作するコード。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps Multiple Markers - jQuery JSON</title>
<script src="http://maps.google.com/maps/api/js?sensor=false"
type="text/javascript"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.ui.map.js"></script>
</head>
<body>
<div id="map_canvas" style="width: 800px; height: 600px;"></div>
<script type="text/javascript">
$(function(){
$('#map_canvas').gmap().bind('init', function(){
$.getJSON('http://www.artectodesignstudios.com/RSSData.txt', function(data){
$.each(data.title, function(i, marker){
$('#map_canvas').gmap('addMarker',{
'position': new google.maps.LatLng(marker[i]["geo:lat"], marker[i]["geo:long"]),
'bounds':true
}).click(function(){
$('#map_canvas').gmap('openInfoWindow', {'content': marker.content}, this);
});
});
});
});
});
<script>
</body>
</html>
</ p>