欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

当地天气调用

程序员文章站 2022-04-14 17:09:00
Document ......
<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>document</title>
    <style>
    body{
        color: red;
        background: #fff;
    }
    </style>
</head>

<body>
    <div class="weather">
        <iframe class="iframe" name="weather_iframe" scrolling="no" frameborder="0" allowtransparency="true" src="//i.tianqi.com/index.php?c=code&id=12&color=%23ffffff&icon=1&num=1&site=12"></iframe>
    </div>
    <div id="tp-weather-widget"></div>
    <script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
    <script>
    (function(t, h, i, n, k, p, a, g, e) {
        g = function() {
            p = h.createelement(i);
            a = h.getelementsbytagname(i)[0];
            p.src = k;
            p.charset = "utf-8";
            p.async = 1;
            a.parentnode.insertbefore(p, a)
        };
        t["thinkpageweatherwidgetobject"] = n;
        t[n] || (t[n] = function() {
            (t[n].q = t[n].q || []).push(arguments)
        });
        t[n].l = +new date();
        if (t.attachevent) {
            t.attachevent("onload", g)
        } else {
            t.addeventlistener("load", g, false)
        }
    }(window, document, "script", "tpwidget", "//widget.seniverse.com/widget/chameleon.js"))
    
    tpwidget("init", {       
        "flavor": "slim",
               "location": "wx4fbxxfke4f",
               "geolocation": "enabled",
               "language": "zh-chs",
               "unit": "c",
               "theme": "chameleon",
               "container": "tp-weather-widget",
               "bubble": "enabled",
               "alarmtype": "badge",
               "color": "#f47837",
               "uid": "uc6ad9e048",
               "hash": "76465b415261736ddd08da3f7f9b24d0"   
    });   
    tpwidget("show");
    </script>
</body>

</html>