Search code examples
jqueryiosgeolocationmobile-safari

JavaScript callback in mobile Safari


Here is the code I have:

$.getJSON("http:\/\/tinygeocoder.com\/create-api.php?g=" + lat + "," + lng + "&callback=?", function(data) {
      alert(data);};

and it's working fine in Chrome and Safari... but fails in mobile Safari. Here is the error i'm getting:

http://tinygeocoder.com/create-api.php?g=39.67997936,-104.(removed for space)&callback=jsonp1302553994489
SyntaxError: Parse error

Anyone have any ideas?


Solution

  • When I try to browse to that URL, I get this response back:

    Bummer, we've had too many queries and one of our data sources has decided not to work. Please <a href="mailto:[email protected]">let us know</a>.
    

    As this is not JSON, it causes your parsing error.