————————————————————————————

<script type="text/javascript" language="javascript" src="http://www.google.com/jsapi"></script>
        <script type="text/javascript">
            //初始化函数
            function init(){
                //判断google的城市是否可用
                if( google.loader.ClientLocation.address.city) {
                    //通过google的api获取城市信息
                    var locationCity = google.loader.ClientLocation.address.city;
                    alert(locationCity);//展示城市的信息结果
                }
            }
</script>

——————————————————————————

<body onload="init();">
    </body>

——————————————————————————

相关文章:

  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2021-10-05
  • 2021-09-15
  • 2021-05-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-08
  • 2021-09-13
  • 2021-12-02
  • 2022-02-10
  • 2021-08-16
相关资源
相似解决方案