获取本地的ip,地址,code

<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>t1</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
</head>
<body>
    <h1>点击获取ip</h1>
    <br>
    <button class="xxx-btn" onclick="aa()">click me</button>
    <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
    <script>
    function aa() {  
        alert(returnCitySN['cip'] + returnCitySN['cname']);
        console.log(returnCitySN);
    };
   
    </script>
    
</body>

</html>

    
View Code

 

posted @ 2017-10-12 18:25  风吹麦浪打  阅读(126)  评论(0编辑  收藏  举报