Javascript examples for jQuery Method and Property:ajax
Get city name using geolocation via ajax
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> <script type="text/javascript"> window.onload=function(){//from w w w . j a v a2s. c o m $.get("https://api.ipdata.co/?api-key=test", function (response) { $("#response").html(JSON.stringify(response, null, 4)); }, "jsonp"); } </script> </head> <body> <pre id="response"></pre> </body> </html>