title: jQuery and Google Maps json response
body: <p>I am having troubles getting geo location info from google maps api</p>
  
  <p>the code is pretty straight forward</p>
  
  <pre><code>$.ajax({
      type: "GET",
      cache: false,
      url: "http://maps.googleapis.com/maps/api/geocode/json",
      dataType: "jsonp",
      data: {
          address: "Ljubljana " + "Slovenia",
          sensor: "false"
      },
      jsonpCallback:'json_response',
      success: function(data) {
          top.console.debug(data);
          $('#location_setter').dialog('close');
      },
      error: function() {
          alert("Error.");
      }
  });
  
  
  function json_response(data){
      alert("works");
  }
  </code></pre>
  
  <p>I always get an error back.
  I tried directly too (I read somewhere that the callback should be set at the end...</p>
  
  <pre><code>$.ajax({
      type: "GET",
      cache: true,
      url: "http://maps.googleapis.com/maps/api/geocode/json?address=Ljubljana Slovenia&amp;sensor=false",
      dataType: "jsonp",
      jsonpCallback:'json_response',
      success: function(data) {
          top.console.debug(data);
          $('#location_setter').dialog('close');
      },
      error: function() {
          alert("Error.");
      }
  });
  </code></pre>
  
  <p>the request url is correctly formed:</p>
  
  <p><a href="http://maps.googleapis.com/maps/api/geocode/json?address=Ljubljana%20Slovenia&amp;sensor=false&amp;callback=json_response" rel="noreferrer">http://maps.googleapis.com/maps/api/geocode/json?address=Ljubljana%20Slovenia&amp;sensor=false&amp;callback=json_response</a></p>
  
  <p>and it gives me the correct json</p>
  
  <p>please advise!</p>
  
  <p>You can 'play' with it at <a href="http://jsfiddle.net/PNad9/" rel="noreferrer">http://jsfiddle.net/PNad9/</a></p>