一个免费的天气预报json服务

tianxz 2009-07-09 01:17:36
这边有一个天气预报服务,提供json数据。链接是http://mrlu.host22.com/weather.php?callback=cb
返回结果是:
cb({"city":"London,UK","fdate":"2009-07-08","ctime":"2009-07-08 16:55:54 +0000","unit"
:"US","cond":"Mostly Cloudy","ftemp":"66","ctemp":"19","humi":"Humidity: 64%","icon":"/ig/images/weather
/mostly_cloudy.gif","week1":"Wed","low1":"56","high1":"70","icon1":"/ig/images/weather/chance_of_storm
.gif","cond1":"Scattered Tnunderstorms","week2":"Thu","low2":"61","high2":"77","icon2":"/ig/images/weather
/partly_cloudy.gif","cond2":"Partly Cloudy","week3":"Fri","low3":"68","high3":"79","icon3":"/ig/images
/weather/chance_of_storm.gif","cond3":"Isolated Thunderstorms","week4":"Sat","low4":"58","high4":"77"
,"icon4":"/ig/images/weather/chance_of_storm.gif","cond4":"Scattered Tnunderstorms"});

大家看看有啥问题
...全文
514 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
mykelly6 2009-07-10
  • 打赏
  • 举报
回复
http://www.webxml.com.cn/zh_cn/index.aspx
以前找到的一个web service,好像数据是xml的吧,各种服务都有,还是不错的
mykelly6 2009-07-10
  • 打赏
  • 举报
回复
数据都得到了,自己理清不就好了么。
实在不行自己分割字符串就得了

返回空值的话就当error处理,再次请求数据,或者报错。
tianxz 2009-07-09
  • 打赏
  • 举报
回复
主要是有时候返回空值,不知道为什么。所以请大家帮忙调试一下,不知道大家有什么建议。需要什么更好的service?谢谢!
KK3K2005 2009-07-09
  • 打赏
  • 举报
回复
这个东西 eval 调试下不就知道有没问题了
tianxz 2009-07-09
  • 打赏
  • 举报
回复
是的,请问有毛病,请多多指点。
街头小贩 2009-07-09
  • 打赏
  • 举报
回复
你是不是用echo 打印出来的!
tianxz 2009-07-09
  • 打赏
  • 举报
回复
帮忙测试一下,谢谢了!

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧