WebService Call

by uber42

HTML

<button id="call">Call</button>
<div id="results">

</div>

JavaScript

$('#call').bind('click', function() {
  $.ajax({
    url: 'http://www.mapquestapi.com/geocoding/v1/address?',
    type: 'POST',
    dataType: 'jsonp',
    data: {
      Address: 'test',
      key: 'VpQPNK91YnIbLecUG9YyR7UK69GEt8oP',
      location: 'Washington,DC'
    },
    success: function(result) {
      console.log(result);
      var myData = JSON.parse(result);
      var $results = $('#results');
      $(this.displayLatLng).appendTo($results);
    }
  });
});