$.get("http://ipinfo.io", function(response) { var uri = "https://secure2.convio.net/pkdf/site/CRTeamraiserAPI"; var postdata = "method=getTeamraisersByDistance&v=1.0&api_key=PkDk3y&starting_postal=64114&list_page_size=1&list_filter_column=name&search_distance=150&response_format=json"; $.post(uri, postdata, function(data, textStatus, jqxhr){ data2 = $.parseJSON(data); if (data2["getTeamraisersResponse"]["teamraiser"]){ name = data2["getTeamraisersResponse"]["teamraiser"]["name"]; url = data2["getTeamraisersResponse"]["teamraiser"]["greeting_url"]; if (name){ $("#closestWalk").html("Auto Select: " + name + ""); } } else { $("#closestWalk").html("Auto Select:
There are no walks detected in your area, but you should check out the Virtual Walk!"); } }); }, "jsonp");