根据ip确定城市

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="js/jquery-1.7.min.js" type="text/javascript"></script>
   <script src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js" type="text/ecmascript"></script>
    <script type="text/javascript">
        function getIpPlace() {
 
 
        alert(remote_ip_info["province"] + "" + ',' + remote_ip_info["city"] + "")
 
 
        } </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input id="Button1" type="button" value="根据IP地址获取所在城市并显示给用户" onclick="getIpPlace();" />
    </div>
    </form>
</body>
</html>

 

posted @ 2018-06-29 17:44  牛哥聊技术  阅读(187)  评论(0编辑  收藏  举报