Find City and Region in Web Application using Lat and Long

  1. <html xmlns="http://www.w3.org/1999/xhtml">  
  2.    <head runat="server">  
  3.       <script src="JS/jquery-2.1.1.js"></script>  
  4.          <title></title>  
  5.       <script>  
  6.          function GetLocation()  
  7.          {  
  8.             $.get("http://ipinfo.io"function (response) {  
  9.                $("#ip").html("IP: " + response.ip);  
  10.                $("#address").html("Location: " + response.city + ", " + response.region);  
  11.                $("#details").html(JSON.stringify(response, null, 4));  
  12.             }, "jsonp");  
  13.          }  
  14.       </script>  
  15.    </head>  
  16.    <body onload="GetLocation()">  
  17.       <form id="form1" runat="server">  
  18.          <div id="ip"></div>  
  19.          <div id="address"></div>  
  20.          <hr/>Full response: <pre id="details"></pre>  
  21.       </form>  
  22.    </body>  
  23. </html>