How does jQuery obtain Geographic location through IP address
Editor to share with you how jQuery through the IP address to get the location, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Get the geographic location through the IP address
There are many online services that can tell us the city and country where the IP address is located. Let's first ping to Baidu's IP address, and then get its geographical location:
Var ip = '119.75.218.70', api = 'http://freegeoip.net/json/' + ip +'? callback=?';$.getJSON (api, function (r) {console.log ('How is the weather in' + r.city +','+ r.country_name +'?);}). The above is all the content of the article "how jQuery gets geographical location through IP address". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!