Skip to content

Instantly share code, notes, and snippets.

@stimms
Created June 28, 2011 18:14
Show Gist options
  • Save stimms/1051781 to your computer and use it in GitHub Desktop.
Save stimms/1051781 to your computer and use it in GitHub Desktop.
jQuery for querying latitude and longitude from a site
//create the results table
$(".bottomframe").append("<table id='results'><tr><th>Latitude</th><th>Logitude</th></tr></table>");
//only do one request at a time
$.ajaxSetup({async:false});
//perform the lookup
$.post("http://www.ags.gov.ab.ca/gis/map_converters/Convert_ATS_CGI.exe", {FTN:0, FTW:0, ILN: 5, IMN:4,IRN:3,ISN:1, ITN: 2, SPS: 'C'},
function(data){
var latitude = $($(data).find("td[colspan=3]")[0]).text();
var longitude = $($(data).find("td[colspan=3]")[1]).text();
$("#results").append("<tr><td>" + latitude + "</td><td>" + longitude + "</td></tr>");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment