title: Put Json/Jsonp data to a form using ajax
body: <p>The chinese map service "Tencent map" provides a Json/Jsonp URL to get the location information, the URL is like:</p>
  
  <p><a href="http://apis.map.qq.com/ws/geocoder/v1/?location=39.984154,116.307490&amp;key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77&amp;get_poi=1" rel="nofollow">http://apis.map.qq.com/ws/geocoder/v1/?location=39.984154,116.307490&amp;key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77&amp;get_poi=1</a></p>
  
  <p>Assume that I fill the latitude and longitude into a form, how to use JS/JQ to get the Json date and fill the "pois"(which in the json-> result -> pois ) data to a drop-down menu in the form?</p>
  
  <p>The html I wrote is like:</p>
  
  <pre><code>&lt;from&gt;
      &lt;lable&gt;Oraginal GPS coordinates&lt;/lable&gt;&lt;/br&gt;
      &lt;input type="text" id="geo_latitude" name="geo_latitude" value="39.86343486063931"&gt;
      &lt;input type="text" id="geo_longitude" name="geo_longitude" value="116.37321682380312"&gt;
  &lt;button onclick="getLocation()"&gt;GET it&lt;/button&gt;
      &lt;select id="geo_spot" name="geo_spot"&gt;
          &lt;option&gt;&lt;/option&gt;
      &lt;/select&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The Js is:(to make it jsonp I added "?output=jsonp" in the url to make it Jsonp to avoid Cross domain error)</p>
  
  <pre><code>    jQuery(document).ready(function(){
          var lat = parseFloat(document.getElementById("geo_latitude").value);
          var lng = parseFloat(document.getElementById("geo_longitude").value);
         var url='http://apis.map.qq.com/ws/geocoder/v1/?output=jsonp&amp;location='+lat+','+lng+'&amp;key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77&amp;get_poi=1&amp;callback=?';
         jQuery.ajax({
           url:url,
           dataType:'jsonp',
           processData: true,
           type:'get',
           jsonp: "callback",
           contentType: "application/jsonp; charset=utf-8",
           success:function(data){
             alert(jsonp.result.pois);
           },
           error:function(XMLHttpRequest, textStatus, errorThrown) {
             alert(XMLHttpRequest.status);
             alert(XMLHttpRequest.readyState);
             alert(textStatus);
           }});
         });
  </code></pre>
  
  <p>My target is to add up all Pois date in Jsonp into that drop down  options, but after tried and tried, I can't even get the date....</p>
  
  <p>Can you point out the mistake of my code? That would be very helpful!</p>
  
  <p>I put a sample here so you can test my MISTAKE <a href="http://fireso.com/geo.html" rel="nofollow">http://fireso.com/geo.html</a> </p>
  
  <p>PS, I can't modify the server part code, and have to use the api in a different domain, so the only way is working with the html js part.</p>
  
  <p>Thank you for any help!</p>