您的位置:首页 > Web前端 > JavaScript

关于jsonp访问天气预报功能

2016-08-17 00:31 253 查看
写了一段关于访问天气预报功能小代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title></title>

    <script type="text/javascript" src="jquery-1.10.2.min.js"></script>

    <script type="text/javascript">

     $(function(){

      //alert('load....');

      $.get('https://api.thinkpage.cn/v3/weather/now.json?key=pqco8hlgjeuvsdu3&location=beijing&language=zh-Hans&unit=c',function(data){

         $.each(data.results,function(i,da){

                  alert('i:'+da.location.id+da.location.name);

         });

      });

     });

    </script>

   <!--script type="text/javascript" src="https://api.thinkpage.cn/v3/weather/now.json?key=pqco8hlgjeuvsdu3&location=beijing&language=zh-Hans&unit=c"></<script-->

</head>

<body>

 

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: