title: parse google place json with javascript
body: <p>for any reason this code doesn't seem to work</p>
  
  <pre><code>var request = "https://maps.googleapis.com/maps/api/place/search/json?";
  request = request + "location="+lat+","+lng+"&amp;";
  request = request + "radius=500&amp;";
  request = request + "types=&amp;";
  request = request + "name=&amp;";
  request = request + "sensor=false&amp;";
  request = request + "key="+key;
  
  $.getJSON(request, function(data){ alert(data); });
  </code></pre>
  
  <p>The string is valid and i get the result if i just load it in my browser. Do you see anything wrong here?</p>
  
  <p>EDIT: alright, problem solved. The Google Places API actually does not accept ajax jsonp calls. I'll have to use their javascript API instead. See this thread for more details:</p>
  
  <p><a href="https://stackoverflow.com/questions/6159246/how-do-i-use-google-places-to-get-an-array-of-place-names">How do I use Google Places to get an array of Place names?</a></p>
  
  <hr>
  
  <p>Thanks for your replies. So I now make the API call with the following code:</p>
  
  <pre><code>    $.ajax({
      url: "https://maps.googleapis.com/maps/api/place/search/json",
      dataType: 'jsonp',
      data: {
          location:lat+","+lng,
          radius:500,
          types:"",
          name:"",
          sensor:"false",
          key:key
      },
      success: function(data) {
          alert(data);
      }
  });
  </code></pre>
  
  <p>Whiich doesn't show any alert box. By inspecting the code, I catch an error message: </p>
  
  <pre><code>   "html_attributions" : [],
    json:2Uncaught SyntaxError: Unexpected Token :
  </code></pre>
  
  <p>"results" : [
        {</p>
  
  <p>However, following this error message, in the console, the requested data actually shows in the "results" field... Any idea?</p>