A simple small application that uses jquery to obtain the address through the user's ip, providing free source code ~~
Code:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>PHP中文网</title> </head> <body> <p></p> <script src="http://www.jq22.com/jquery/jquery-2.1.1.js"></script> <script type="text/javascript"> $.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js', function(_result) { if (remote_ip_info.ret == '1') { $("p").text('国家:' + remote_ip_info.country +'\n'+'省:' + remote_ip_info.province +'\n'+'市:' + remote_ip_info.city +'\n'+'区:' + remote_ip_info.district + +'\n'+'ISP:' + remote_ip_info.isp +'\n'+'类型:' + remote_ip_info.type + +'\n'+'其他:' + remote_ip_info.desc); } else { alert('没有找到匹配的IP地址信息!') } }); </script> </script> </body> </html>
Get it for free and study it! More good source codes are available on PHP Chinese website, follow us and give you a good look~
Related recommendations:
css, jquery to realize 3D three-dimensional rotation
jquery to realize gesture unlocking source code
Native js can be implemented Mobile prompt div box source code
The above is the detailed content of jquery implements obtaining address through ip. For more information, please follow other related articles on the PHP Chinese website!