trying to read a file with jquery and completely lost.
I have a data file like so ...
- <?xml version="1.0" encoding="UTF-8"?>
<loc version="1.0" src="GSAK">
<waypoint>
<name id="GC1D004"><![CDATA[Zone of Influence]]></name>
<coord lat="47.435067" lon="-123.055417"/>
<type>Geocache</type>
<link text="Waypoint Details">http://www.geocaching.com/seek/cache_details.aspx?guid=bf163abd-8d00-4bef-9443-9200419c34bc</link>
</waypoint>
<waypoint>
<name id="GC1D00Q"><![CDATA[Welcome Wagon]]></name>
<coord lat="47.432517" lon="-123.070183"/>
<type>Geocache</type>
<link text="Waypoint Details">http://www.geocaching.com/seek/cache_details.aspx?guid=533f2f1b-d48b-4139-b337-cf281fa61677</link>
</waypoint>
- </loc>
I got a code fragment from an example google maps like so ....
jQuery.get("data.xml", {}, function(data) { jQuery(data).find("marker").each(function() { var marker = jQuery(this); var latlng = new google.maps.LatLng(parseFloat(marker.attr("lat")), parseFloat(marker.attr("lng"))); var marker = new google.maps.Marker({position: latlng, map: map}); }); }); and it had a data file like so ...
<markers>
<marker lat="37.427770" lng="-122.144841"/>
<marker lat="37.413320" lng="-122.125604"/>
<marker lat="37.433480" lng="-122.139062"/>
<marker lat="37.445427" lng="-122.162307"/>
</markers>
So far I have not been able to figure out how to get jQuery
to read my data file. I know nothing about jQuery and can do
javascript,sort of. Suggestions would be appreciated.