angular框架下的跨域问题(获取天气数据)

一、新浪天气:http://php.weather.sina.com.cn/iframe/index/w_cl.php?code=js&day=0&city=&dfc=1&charset=utf-8javascript

二、中国天气网:1)http://www.weather.com.cn/data/sk/101010100.html  2)http://www.weather.com.cn/data/cityinfo/101010100.htmlphp

三、中国万年历:1)http://wthrcdn.etouch.cn/weather_mini?city=北京  2)http://wthrcdn.etouch.cn/weather_mini?citykey=101010100html

四、和风天气(天气服务1天免费试用,城市查询服务免费,不推荐使用)java

var key='';//自行输入获取的key
$.getJSON('https://free-api.heweather.com/v5/now?city=苏州&key='+key,function (data) { })

五、心知天气git

官方连接:https://github.com/seniverse/seniverse-api-demos/blob/master/javascript/jsonp.htmlgithub

参考连接:http://www.jianshu.com/p/fa6e5eb6ba86json

六、百度APIapi

          var type='jsonp';
                var ak='';//自行输入百度获取的ak
                var url='http://api.map.baidu.com/location/ip?callback=JSON_CALLBACK';

                //经过IP获取当前地理位置
                $http({
                    method: type, // 支持jsonp,
                    url: url,
                    params: { // 请求的参数
                        ak: ak
                    },
                }).success(function (locationData) {

                    
                })
相关文章
相关标签/搜索