用JS經過新浪天氣API接口獲取天氣

先上代碼 從代碼中能夠看到js是從http://php.weather.sina.com.cn/iframe/index/w_cl.php?code=js&day=0&city=&dfc=1&charset=utf-8php 獲取天氣的. 這裏首先是city= 是自動定位到你的城市的.css 而後遍歷數組,獲得 city: 城市,day_weather:白每天氣,night_weather:夜晚天
相關文章
相關標籤/搜索