Created
June 28, 2011 18:14
-
-
Save stimms/1051781 to your computer and use it in GitHub Desktop.
jQuery for querying latitude and longitude from a site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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