[jQuery] Problems with getJSON between browsers
Hello,
I am trying to request the json feed from Google Latitude. This script
is working perfectly in Safari 4, but I get a 400 Bad Request error in
FF 3.5. If I add the &callback=? to the end of the URL, then FF 3.5
hits me with an Invalid Label error which I can't work around (tried
eval). Also, adding &callback=? to the end of the URL results in a
syntax error in result in Safari 4.
Can anyone point me in the right direction here?
<code>
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript" charset="utf-8">
// Just using the google ajax library service for simplicity sake.
Replace this with the regular jQuery installation
google.load("jquery", "1");
google.setOnLoadCallback(function() {
loadLatitudeLocationData();
});
function loadLatitudeLocationData()
{
var url = "http://www.google.com/latitude/apps/badge/api?
user=1798529584061495106&type=json";
$.getJSON(url,
function(data) {
var features = data.features;
console.log(features[0].properties.reverseGeocode);
});
}
</script>
</code>