zoukankan      html  css  js  c++  java
  • 高德天气(纯天气)

    <!doctype html>
    <html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
        <title>天气预报查询</title>
        <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
    </head>
    <body>
    
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=0e0515e5982fbfb4bb949348fe907b16"></script>
    <script type="text/javascript">
    //实时天气
    function weatherLive(city) {
        //加载天气查询插件
        AMap.plugin('AMap.Weather', function() {
            //创建天气查询实例
            var weather = new AMap.Weather();
        
            //执行实时天气信息查询
            weather.getLive(city, function(err, data) {
                alert("实时天气==" + JSON.stringify(data));
                return data;
            });
            
           
        });
    }
    
    //实时天气
    function weatherForecast(city) {
        //加载天气查询插件
        AMap.plugin('AMap.Weather', function() {
            //创建天气查询实例
            var weather = new AMap.Weather();
            
            //执行天气预报查询
            weather.getForecast(city, function(err, data) {
                alert("天气预报==" + JSON.stringify(data));
                return data;
            });
        });
    }
    
    $(document).ready(function() { 
        weatherLive("武汉");
    })
    </script>
    </body>
    </html>
  • 相关阅读:
    gdb调试core文件
    设计模式之工厂模式
    设计模式之简单工厂模式
    正确理解python的装饰器
    深入理解MVC架构
    django的模板系统过滤器笔记
    python net-snmp 的使用
    用django写个CMS系统
    django的CMS系统(内容管理系统)
    RESTful 的通俗解释
  • 原文地址:https://www.cnblogs.com/hedongfei/p/11964734.html
Copyright © 2011-2022 走看看