<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<style type="text/css">
.btn{100px;}
</style>
</head>
<body>
<h1>获取本地ip地址方法</h1>
<br>
<button class="btn" onclick="getIp()">点击获取ip</button>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script>
function getIp() {
console.log(returnCitySN);
alert(returnCitySN['cip'] + returnCitySN['cname']);
};
</script>
</body>
</html>