js获取本地IP地址(局域网)

<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JavaScript</title>
</head>
<body>
<h1>获取客户端IP[利用搜狐接口]</h1>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>  
<script type="text/javascript">  
document.write(returnCitySN["cip"]+','+returnCitySN["cname"])  
</script>

</body>
</html>

猜你喜欢

转载自blog.csdn.net/yufengaotian/article/details/79715557