这边有一个天气预报服务,提供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"});大家看看有啥问题

解决方案 »

  1.   

    你是不是用echo 打印出来的!
      

  2.   

    这个东西 eval 调试下不就知道有没问题了
      

  3.   

    主要是有时候返回空值,不知道为什么。所以请大家帮忙调试一下,不知道大家有什么建议。需要什么更好的service?谢谢!
      

  4.   

    数据都得到了,自己理清不就好了么。
    实在不行自己分割字符串就得了返回空值的话就当error处理,再次请求数据,或者报错。
      

  5.   

    http://www.webxml.com.cn/zh_cn/index.aspx
    以前找到的一个web service,好像数据是xml的吧,各种服务都有,还是不错的