我知道我的json数据是有效的,因为我直接从API中提取它。当我调用$ .parseJSON()时出现错误
Unexpected token ↵
关于这是什么的任何想法?
var forecastData = $.parseJSON(jsonData);
我将jsonData的值带入了一个json验证器,它说它是有效的
var jsonData = '{"latitude":40.5122,"longitude":-88.9886,"timezone":"America/Chicago","offset":-6,"currently":{"time":1417792950,"summary":"Drizzle","icon":"rain","nearestStormDistance":0,"precipIntensity":0.0045,"precipIntensityError":0.0005,"precipProbability":0.46,"precipType":"rain","temperature":33.99,"apparentTemperature":29.09,"dewPoint":33.46,"humidity":0.98,"windSpeed":5.38,"windBearing":128,"visibility":1.12,"cloudCover":1,"pressure":1022.75,"ozone":279.41},"minutely":{"summary":"Drizzle stopping in 1 min., starting again 20 min. later.","icon":"rain","data":[{"time":1417792920,"precipIntensity":0.0047,"precipIntensityError":0.0006,"precipProbability":0.48,"precipType":"rain"},{"time":1417792980,"precipIntensity":0.0042,"precipIntensityError":0.0004,"precipProbability":0.43,"precipType":"rain"},{"time":1417793040,"precipIntensity":0.0042,"precipIntensityError":0.0006,"precipProbability":0.43,"precipType":"rain"},{"time":1417793100,"precipIntensity":0.0043,"precipIntensityError":0.0008,"precipProbability":0.44,"precipType":"rain"},{"time":1417793160,"precipIntensity":0.0041,"precipIntensityError":0.0009,"precipProbability":0.41,"precipType":"rain"},{"time":1417793220,"precipIntensity":0.0039,"precipIntensityError":0.0011,"precipProbability":0.37,"precipType":"rain"},{"time":1417793280,"precipIntensity":0.0037,"precipIntensityError":0.0011,"precipProbability":0.34,"precipType":"rain"},{"time":1417793340,"precipIntensity":0.0034,"precipIntensityError":0.001,"precipProbability":0.29,"precipType":"rain"},{"time":1417793400,"precipIntensity":0.0035,"precipIntensityError":0.001,"precipProbability":0.3,"precipType":"rain"},{"time":1417793460,"precipIntensity":0.0035,"precipIntensityError":0.001,"precipProbability":0.31,"precipType":"rain"},{"time":1417793520,"precipIntensity":0.0036,"precipIntensityError":0.0011,"precipProbability":0.32,"precipType":"rain"},{"time":1417793580,"precipIntensity":0.0035,"precipIntensityError":0.001,"precipProbability":0.3,"precipType":"rain"},{"time":1417793640,"precipIntensity":0.0036,"precipIntensityError":0.001,"precipProbability":0.31,"precipType":"rain"},{"time":1417793700,"precipIntensity":0.0037,"precipIntensityError":0.0012,"precipProbability":0.32,"precipType":"rain"},{"time":1417793760,"precipIntensity":0.0039,"precipIntensityError":0.0013,"precipProbability":0.34,"precipType":"rain"},{"time":1417793820,"precipIntensity":0.0042,"precipIntensityError":0.0015,"precipProbability":0.36,"precipType":"rain"},{"time":1417793880,"precipIntensity":0.0042,"precipIntensityError":0.0016,"precipProbability":0.36,"precipType":"rain"},{"time":1417793940,"precipIntensity":0.0043,"precipIntensityError":0.0015,"precipProbability":0.36,"precipType":"rain"},{"time":1417794000,"precipIntensity":0.0045,"precipIntensityError":0.0016,"precipProbability":0.38,"precipType":"rain"},{"time":1417794060,"precipIntensity":0.0048,"precipIntensityError":0.0016,"precipProbability":0.42,"precipType":"rain"},{"time":1417794120,"precipIntensity":0.005,"precipIntensityError":0.0017,"precipProbability":0.45,"precipType":"rain"},{"time":1417794180,"precipIntensity":0.0051,"precipIntensityError":0.0016,"precipProbability":0.46,"precipType":"rain"},{"time":1417794240,"precipIntensity":0.0053,"precipIntensityError":0.0017,"precipProbability":0.49,"precipType":"rain"},{"time":1417794300,"precipIntensity":0.0055,"precipIntensityError":0.0018,"precipProbability":0.52,"precipType":"rain"},{"time":1417794360,"precipIntensity":0.0057,"precipIntensityError":0.0018,"precipProbability":0.55,"precipType":"rain"},{"time":1417794420,"precipIntensity":0.0058,"precipIntensityError":0.0019,"precipProbability":0.56,"precipType":"rain"},{"time":1417794480,"precipIntensity":0.0058,"precipIntensityError":0.0019,"precipProbability":0.56,"precipType":"rain"},{"time":1417794540,"precipIntensity":0.0058,"precipIntensityError":0.0018,"precipProbability":0.55,"precipType":"rain"},{"time":1417794600,"precipIntensity":0.0059,"precipIntensityError":0.0018,"precipProbability":0.57,"precipType":"rain"},{"time":1417794660,"precipIntensity":0.0061,"precipIntensityError":0.0019,"precipProbability":0.59,"precipType":"rain"},{"time":1417794720,"precipIntensity":0.0063,"precipIntensityError":0.0019,"precipProbability":0.61,"precipType":"rain"},{"time":1417794780,"precipIntensity":0.0062,"precipIntensityError":0.0018,"precipProbability":0.59,"precipType":"rain"},{"time":1417794840,"precipIntensity":0.0064,"precipIntensityError":0.0019,"precipProbability":0.61,"precipType":"rain"},{"time":1417794900,"precipIntensity":0.0066,"precipIntensityError":0.002,"precipProbability":0.64,"precipType":"rain"},{"time":1417794960,"precipIntensity":0.0068,"precipIntensityError":0.0021,"precipProbability":0.66,"precipType":"rain"},{"time":1417795020,"precipIntensity":0.0069,"precipIntensityError":0.0023,"precipProbability":0.66,"precipType":"rain"},{"time":1417795080,"precipIntensity":0.0071,"precipIntensityError":0.0024,"precipProbability":0.68,"precipType":"rain"},{"time":1417795140,"precipIntensity":0.0071,"precipIntensityError":0.0024,"precipProbability":0.67,"precipType":"rain"},{"time":1417795200,"precipIntensity":0.0074,"precipIntensityError":0.0026,"precipProbability":0.7,"precipType":"rain"},{"time":1417795260,"precipIntensity":0.0078,"precipIntensityError":0.0028,"precipProbability":0.74,"precipType":"rain"},{"time":1417795320,"precipIntensity":0.0082,"precipIntensityError":0.0029,"precipProbability":0.79,"precipType":"rain"},{"time":1417795380,"precipIntensity":0.0084,"precipIntensityError":0.003,"precipProbability":0.79,"precipType":"rain"},{"time":1417795440,"precipIntensity":0.0089,"precipIntensityError":0.0032,"precipProbability":0.85,"precipType":"rain"},{"time":1417795500,"precipIntensity":0.0093,"precipIntensityError":0.0034,"precipProbability":0.88,"precipType":"rain"},{"time":1417795560,"precipIntensity":0.0097,"precipIntensityError":0.0036,"precipProbability":0.88,"precipType":"rain"},{"time":1417795620,"precipIntensity":0.0101,"precipIntensityError":0.0038,"precipProbability":0.87,"precipType":"rain"},{"time":1417795680,"precipIntensity":0.0105,"precipIntensityError":0.0039,"precipProbability":0.87,"precipType":"rain"},{"time":1417795740,"precipIntensity":0.0107,"precipIntensityError":0.004,"precipProbability":0.85,"precipType":"rain"},{"time":1417795800,"precipIntensity":0.0112,"precipIntensityError":0.0042,"precipProbability":0.85,"precipType":"rain"},{"time":1417795860,"precipIntensity":0.0117,"precipIntensityError":0.0043,"precipProbability":0.85,"precipType":"rain"},{"time":1417795920,"precipIntensity":0.0121,"precipIntensityError":0.0044,"precipProbability":0.85,"precipType":"rain"},{"time":1417795980,"precipIntensity":0.0124,"precipIntensityError":0.0044,"precipProbability":0.84,"precipType":"rain"},{"time":1417796040,"precipIntensity":0.0129,"precipIntensityError":0.0045,"precipProbability":0.84,"precipType":"rain"},{"time":1417796100,"precipIntensity":0.0133,"precipIntensityError":0.0046,"precipProbability":0.84,"precipType":"rain"},{"time":1417796160,"precipIntensity":0.0137,"precipIntensityError":0.0048,"precipProbability":0.84,"precipType":"rain"},{"time":1417796220,"precipIntensity":0.0142,"precipIntensityError":0.0049,"precipProbability":0.83,"precipType":"rain"},{"time":1417796280,"precipIntensity":0.0145,"precipIntensityError":0.005,"precipProbability":0.82,"precipType":"rain"},{"time":1417796340,"precipIntensity":0.0146,"precipIntensityError":0.005,"precipProbability":0.8,"precipType":"rain"},{"time":1417796400,"precipIntensity":0.0151,"precipIntensityError":0.0052,"precipProbability":0.81,"precipType":"rain"},{"time":1417796460,"precipIntensity":0.0155,"precipIntensityError":0.0053,"precipProbability":0.81,"precipType":"rain"},{"time":1417796520,"precipIntensity":0.0159,"precipIntensityError":0.0054,"precipProbability":0.81,"precipType":"rain"}]},"hourly":{"summary":"Light rain until tomorrow morning.","icon":"rain","data":[{"time":1417791600,"summary":"Light Rain","icon":"rain","precipIntensity":0.0266,"precipProbability":0.75,"precipType":"rain","temperature":33.79,"apparentTemperature":28.74,"dewPoint":33.26,"humidity":0.98,"windSpeed":5.52,"windBearing":132,"visibility":0.59,"cloudCover":1,"pressure":1022.81,"ozone":279.1},{"time":1417795200,"summary":"Light Rain","icon":"rain","precipIntensity":0.0099,"precipProbability":0.86,"precipType":"rain","temperature":34.32,"apparentTemperature":29.62,"dewPoint":33.78,"humidity":0.98,"windSpeed":5.21,"windBearing":120,"visibility":2,"cloudCover":1,"pressure":1022.65,"ozone":279.92},{"time":1417798800,"summary":"Light Rain","icon":"rain","precipIntensity":0.025,"precipProbability":0.64,"precipType":"rain","temperature":35.4,"apparentTemperature":30.81,"dewPoint":34.59,"humidity":0.97,"windSpeed":5.31,"windBearing":113,"visibility":2.48,"cloudCover":1,"pressure":1022.48,"ozone":280.88},{"time":1417802400,"summary":"Light Rain","icon":"rain","precipIntensity":0.027,"precipProbability":0.69,"precipType":"rain","temperature":36,"apparentTemperature":31.58,"dewPoint":35,"humidity":0.96,"windSpeed":5.24,"windBearing":103,"visibility":2.78,"cloudCover":1,"pressure":1022.27,"ozone":281.4},{"time":1417806000,"summary":"Light Rain","icon":"rain","precipIntensity":0.0275,"precipProbability":0.82,"precipType":"rain","temperature":36.79,"apparentTemperature":32.38,"dewPoint":35.75,"humidity":0.96,"windSpeed":5.4,"windBearing":92,"visibility":3.22,"cloudCover":1,"pressure":1021.91,"ozone":280.88},{"time":1417809600,"summary":"Light Rain","icon":"rain","precipIntensity":0.0294,"precipProbability":1,"precipType":"rain","temperature":37.04,"apparentTemperature":32.63,"dewPoint":36.1,"humidity":0.96,"windSpeed":5.46,"windBearing":78,"visibility":3.64,"cloudCover":1,"pressure":1021.48,"ozone":279.91},{"time":1417813200,"summary":"Light Rain","icon":"rain","precipIntensity":0.0276,"precipProbability":0.99,"precipType":"rain","temperature":37.29,"apparentTemperature":33.04,"dewPoint":36.5,"humidity":0.97,"windSpeed":5.32,"windBearing":71,"visibility":4.64,"cloudCover":1,"pressure":1021.18,"ozone":279.7},{"time":1417816800,"summary":"Light Rain","icon":"rain","precipIntensity":0.0311,"precipProbability":0.95,"precipType":"rain","temperature":36.64,"apparentTemperature":31.81,"dewPoint":36.06,"humidity":0.98,"windSpeed":5.93,"windBearing":59,"visibility":4.18,"cloudCover":1,"pressure":1021.06,"ozone":280.98},{"time":1417820400,"summary":"Light Rain","icon":"rain","precipIntensity":0.043,"precipProbability":0.89,"precipType":"rain","temperature":36.12,"apparentTemperature":30.92,"dewPoint":35.69,"humidity":0.98,"windSpeed":6.3,"windBearing":50,"visibility":3.47,"cloudCover":1,"pressure":1021.06,"ozone":283.01},{"time":1417824000,"summary":"Light Rain","icon":"rain","precipIntensity":0.052,"precipProbability":0.86,"precipType":"rain","temperature":35.38,"apparentTemperature":29.22,"dewPoint":35.04,"humidity":0.99,"windSpeed":7.56,"windBearing":37,"visibility":3.08,"cloudCover":1,"pressure":1021.22,"ozone":284.8},{"time":1417827600,"summary":"Light Rain","icon":"rain","precipIntensity":0.0407,"precipProbability":0.87,"precipType":"rain","temperature":35.29,"apparentTemperature":28.36,"dewPoint":34.97,"humidity":0.99,"windSpeed":8.89,"windBearing":32,"visibility":3.57,"cloudCover":1,"pressure":1021.57,"ozone":285.83},{"time":1417831200,"summary":"Light Rain","icon":"rain","precipIntensity":0.0266,"precipProbability":0.87,"precipType":"rain","temperature":35.28,"apparentTemperature":27.82,"dewPoint":34.93,"humidity":0.99,"windSpeed":9.93,"windBearing":26,"visibility":4.27,"cloudCover":1,"pressure":1022.06,"ozone":286.61},{"time":1417834800,"summary":"Light Rain","icon":"rain","precipIntensity":0.0233,"precipProbability":0.83,"precipType":"rain","temperature":35.26,"apparentTemperature":27.33,"dewPoint":34.84,"humidity":0.98,"windSpeed":10.95,"windBearing":21,"visibility":4.72,"cloudCover":1,"pressure":1022.52,"ozone":287.7},{"time":1417838400,"summary":"Light Rain","icon":"rain","precipIntensity":0.0202,"precipProbability":0.73,"precipType":"rain","temperature":34.84,"apparentTemperature":26.37,"dewPoint":34.37,"humidity":0.98,"windSpeed":11.96,"windBearing":18,"visibility":4.97,"cloudCover":1,"pressure":1022.87,"ozone":289.41},{"time":1417842000,"summary":"Drizzle","icon":"rain","precipIntensity":0.0091,"precipProbability":0.45,"precipType":"rain","temperature":34.71,"apparentTemperature":25.88,"dewPoint":34.18,"humidity":0.98,"windSpeed":12.76,"windBearing":12,"visibility":5.27,"cloudCover":1,"pressure":1023.19,"ozone":291.44},{"time":1417845600,"summary":"Overcast","icon":"cloudy","precipIntensity":0.0046,"precipProbability":0.09,"precipType":"rain","temperature":34.24,"apparentTemperature":25.23,"dewPoint":33.61,"humidity":0.98,"windSpeed":12.92,"windBearing":9,"visibility":5.36,"cloudCover":1,"pressure":1023.58,"ozone":293.4},{"time":1417849200,"summary":"Overcast","icon":"cloudy","precipIntensity":0.0034,"precipProbability":0.05,"precipType":"rain","temperature":33.91,"apparentTemperature":24.64,"dewPoint":32.9,"humidity":0.96,"windSpeed":13.34,"windBearing":6,"visibility":5.2,"cloudCover":1,"pressure":1024.07,"ozone":295.22},{"time":1417852800,"summary":"Light Snow","icon":"snow","precipIntensity":0.0036,"precipProbability":0.06,"precipType":"snow","precipAccumulation":0.02736,"temperature":33.1,"apparentTemperature":23.49,"dewPoint":32.51,"humidity":0.98,"windSpeed":13.67,"windBearing":4,"visibility":4.93,"cloudCover":1,"pressure":1024.65,"ozone":296.98},{"time":1417856400,"summary":"Light Snow","icon":"snow","precipIntensity":0.0036,"precipProbability":0.06,"precipType":"snow","precipAccumulation":0.02736,"temperature":32.66,"apparentTemperature":22.88,"dewPoint":31.64,"humidity":0.96,"windSpeed":13.79,"windBearing":359,"visibility":4.63,"cloudCover":1,"pressure":1025.4,"ozone":298.5},{"time":1417860000,"summary":"Flurries","icon":"snow","precipIntensity":0.0031,"precipProbability":0.05,"precipType":"snow","precipAccumulation":0.023559999999999998,"temperature":32.32,"apparentTemperature":22.41,"dewPoint":31.08,"humidity":0.95,"windSpeed":13.9,"windBearing":358,"visibility":4.3,"cloudCover":1,"pressure":1026.42,"ozone":299.87},{"time":1417863600,"summary":"Flurries","icon":"snow","precipIntensity":0.0026,"precipProbability":0.04,"precipType":"snow","precipAccumulation":0.020302309939033546,"temperature":31.71,"apparentTemperature":21.7,"dewPoint":30.49,"humidity":0.95,"windSpeed":13.73,"windBearing":358,"visibility":4.34,"cloudCover":1,"pressure":1027.53,"ozone":301},{"time":1417867200,"summary":"Flurries","icon":"snow","precipIntensity":0.002,"precipProbability":0.03,"precipType":"snow","precipAccumulation":0.016051678437363326,"temperature":31.35,"apparentTemperature":21.15,"dewPoint":30.05,"humidity":0.95,"windSpeed":13.97,"windBearing":357,"visibility":3.75,"cloudCover":0.99,"pressure":1028.55,"ozone":301.5},{"time":1417870800,"summary":"Overcast","icon":"cloudy","precipIntensity":0.0014,"precipProbability":0.01,"precipType":"snow","precipAccumulation":0.011312537839631572,"temperature":31.26,"apparentTemperature":20.82,"dewPoint":30.1,"humidity":0.95,"windSpeed":14.5,"windBearing":3,"visibility":3.72,"cloudCover":0.99,"pressure":1029.46,"ozone":300.9},{"time":1417874400,"summary":"Overcast","icon":"cloudy","precipIntensity":0,"precipProbability":0,"temperature":31.67,"apparentTemperature":21.09,"dewPoint":29.88,"humidity":0.93,"windSpeed":15.22,"windBearing":5,"visibility":3.73,"cloudCover":0.99,"pressure":1030.33,"ozone":299.67},{"time":1417878000,"summary":"Overcast","icon":"cloudy","precipIntensity":0,"precipProbability":0,"temperature":32.35,"apparentTemperature":21.69,"dewPoint":30.5,"humidity":0.93,"windSpeed":16,"windBearing":10,"visibility":3.79,"cloudCover":0.99,"pressure":1031.11,"ozone":298.8},{"time":1417881600,"summary":"Overcast","icon":"cloudy","precipIntensity":0,"precipProbability":0,"temperature":33.44,"apparentTemperature":23.23,"dewPoint":30.91,"humidity":0.9,"windSpeed":15.59,"windBearing":9,"visibility":5.37,"cloudCover":0.99,"pressure":1031.74,"ozone":298.82},{"time":1417885200,"summary":"Overcast","icon":"cloudy","precipIntensity":0,"precipProbability":0,"temperature":34.71,"apparentTemperature":24.99,"dewPoint":31.39,"humidity":0.87,"windSpeed":15.2,"windBearing":8,"visibility":6.97,"cloudCover":0.99,"pressure":1032.25,"ozone":299.21},{"time":1417888800,"summary":"Overcast","icon":"cloudy","precipIntensity":0,"precipProbability":0,"temperature":35.63,"apparentTemperature":26.27,"dewPoint":31.62,"humidity":0.85,"windSpeed":14.92,"windBearing":8,"visibility":8.21,"cloudCover":0.99,"pressure":1032.74,"ozone":299.4},{"time":1417892400,"summary":"Overcast","icon":"cloudy","precipIntensity":0,"precipProbability":0,"temperature":36.07,"apparentTemperature":26.91,"dewPoint":31.55,"humidity":0.83,"windSpeed":14.69,"windBearing":9,"visibility":9.01,"cloudCover":0.97,"pressure":1033.21,"ozone":299.14},{"time":1417896000,"summary":"Overcast","icon":"cloudy","precipIntensity":0,"precipProbability":0,"temperature":36.78,"apparentTemperature":28.16,"dewPoint":31.82,"humidity":0.82,"windSpeed":13.67,"windBearing":7,"visibility":10,"cloudCover":0.94,"pressure":1033.66,"ozone":298.67},{"time":1417899600,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":36.48,"apparentTemperature":27.89,"dewPoint":31.45,"humidity":0.82,"windSpeed":13.39,"windBearing":8,"visibility":10,"cloudCover":0.91,"pressure":1034.17,"ozone":298.2},{"time":1417903200,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":35.68,"apparentTemperature":26.97,"dewPoint":30.85,"humidity":0.82,"windSpeed":13.13,"windBearing":12,"visibility":10,"cloudCover":0.9,"pressure":1034.84,"ozone":297.71},{"time":1417906800,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":34.5,"apparentTemperature":25.52,"dewPoint":30.08,"humidity":0.84,"windSpeed":13.01,"windBearing":17,"visibility":10,"cloudCover":0.9,"pressure":1035.56,"ozone":297.2},{"time":1417910400,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":33.27,"apparentTemperature":24,"dewPoint":29.32,"humidity":0.85,"windSpeed":12.9,"windBearing":21,"visibility":10,"cloudCover":0.85,"pressure":1036.24,"ozone":296.9},{"time":1417914000,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":32.09,"apparentTemperature":22.69,"dewPoint":28.73,"humidity":0.87,"windSpeed":12.47,"windBearing":24,"visibility":10,"cloudCover":0.71,"pressure":1036.72,"ozone":296.93},{"time":1417917600,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":30.95,"apparentTemperature":21.53,"dewPoint":28.24,"humidity":0.9,"windSpeed":11.85,"windBearing":28,"visibility":10,"cloudCover":0.52,"pressure":1037.06,"ozone":297.16},{"time":1417921200,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":29.98,"apparentTemperature":20.64,"dewPoint":27.75,"humidity":0.91,"windSpeed":11.15,"windBearing":32,"visibility":10,"cloudCover":0.4,"pressure":1037.35,"ozone":297.4},{"time":1417924800,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":29.36,"apparentTemperature":20.24,"dewPoint":27.38,"humidity":0.92,"windSpeed":10.41,"windBearing":37,"visibility":10,"cloudCover":0.38,"pressure":1037.57,"ozone":297.76},{"time":1417928400,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":28.99,"apparentTemperature":20.15,"dewPoint":27.11,"humidity":0.93,"windSpeed":9.71,"windBearing":44,"visibility":10,"cloudCover":0.41,"pressure":1037.71,"ozone":298.14},{"time":1417932000,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":28.63,"apparentTemperature":20,"dewPoint":26.65,"humidity":0.92,"windSpeed":9.2,"windBearing":50,"visibility":10,"cloudCover":0.45,"pressure":1037.8,"ozone":298},{"time":1417935600,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":28.15,"apparentTemperature":19.65,"dewPoint":25.76,"humidity":0.91,"windSpeed":8.8,"windBearing":55,"visibility":10,"cloudCover":0.46,"pressure":1037.89,"ozone":297.01},{"time":1417939200,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":27.67,"apparentTemperature":19.28,"dewPoint":24.64,"humidity":0.88,"windSpeed":8.45,"windBearing":60,"visibility":10,"cloudCover":0.47,"pressure":1037.94,"ozone":295.5},{"time":1417942800,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":27.44,"apparentTemperature":19.15,"dewPoint":23.85,"humidity":0.86,"windSpeed":8.2,"windBearing":64,"visibility":10,"cloudCover":0.52,"pressure":1037.94,"ozone":294},{"time":1417946400,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":27.21,"apparentTemperature":19.01,"dewPoint":23.35,"humidity":0.85,"windSpeed":8.01,"windBearing":66,"visibility":10,"cloudCover":0.63,"pressure":1037.82,"ozone":292.49},{"time":1417950000,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":27.01,"apparentTemperature":18.81,"dewPoint":22.97,"humidity":0.84,"windSpeed":7.95,"windBearing":68,"visibility":10,"cloudCover":0.8,"pressure":1037.64,"ozone":290.97},{"time":1417953600,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":27.19,"apparentTemperature":18.85,"dewPoint":22.78,"humidity":0.83,"windSpeed":8.22,"windBearing":71,"visibility":10,"cloudCover":0.93,"pressure":1037.53,"ozone":290},{"time":1417957200,"summary":"Overcast","icon":"cloudy","precipIntensity":0,"precipProbability":0,"temperature":27.85,"apparentTemperature":19.19,"dewPoint":22.75,"humidity":0.81,"windSpeed":8.96,"windBearing":76,"visibility":10,"cloudCover":0.96,"pressure":1037.64,"ozone":290.02},{"time":1417960800,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":28.81,"apparentTemperature":19.8,"dewPoint":22.8,"humidity":0.78,"windSpeed":9.96,"windBearing":81,"visibility":10,"cloudCover":0.93,"pressure":1037.7,"ozone":290.58},{"time":1417964400,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":30.03,"apparentTemperature":20.95,"dewPoint":22.98,"humidity":0.75,"windSpeed":10.64,"windBearing":85,"visibility":10,"cloudCover":0.92,"pressure":1037.44,"ozone":290.9}]},"daily":{"summary":"Mixed precipitation today through Monday, with temperatures peaking at 41°F on Monday.","icon":"rain","data":[{"time":1417759200,"summary":"Light rain throughout the day.","icon":"rain","sunriseTime":1417784731,"sunsetTime":1417818640,"moonPhase":0.48,"precipIntensity":0.0179,"precipIntensityMax":0.052,"precipIntensityMaxTime":1417824000,"precipProbability":1,"precipType":"rain","temperatureMin":32.44,"temperatureMinTime":1417762800,"temperatureMax":37.29,"temperatureMaxTime":1417813200,"apparentTemperatureMin":25.88,"apparentTemperatureMinTime":1417842000,"apparentTemperatureMax":33.04,"apparentTemperatureMaxTime":1417813200,"dewPoint":34.05,"humidity":0.98,"windSpeed":4.71,"windBearing":77,"visibility":2.39,"cloudCover":0.99,"pressure":1022.87,"ozone":281.84},{"time":1417845600,"summary":"Flurries in the morning.","icon":"snow","sunriseTime":1417871187,"sunsetTime":1417905034,"moonPhase":0.52,"precipIntensity":0.0011,"precipIntensityMax":0.0046,"precipIntensityMaxTime":1417845600,"precipProbability":0.09,"precipType":"snow","precipAccumulation":0.199,"temperatureMin":28.99,"temperatureMinTime":1417928400,"temperatureMax":36.78,"temperatureMaxTime":1417896000,"apparentTemperatureMin":20.15,"apparentTemperatureMinTime":1417928400,"apparentTemperatureMax":28.16,"apparentTemperatureMaxTime":1417896000,"dewPoint":30.46,"humidity":0.9,"windSpeed":13.2,"windBearing":11,"visibility":7.22,"cloudCover":0.87,"pressure":1031.75,"ozone":298.27},{"time":1417932000,"summary":"Overcast throughout the day.","icon":"cloudy","sunriseTime":1417957641,"sunsetTime":1417991430,"moonPhase":0.55,"precipIntensity":0,"precipIntensityMax":0,"precipProbability":0,"temperatureMin":27.01,"temperatureMinTime":1417950000,"temperatureMax":36.47,"temperatureMaxTime":1417982400,"apparentTemperatureMin":18.81,"apparentTemperatureMinTime":1417950000,"apparentTemperatureMax":29.62,"apparentTemperatureMaxTime":1417982400,"dewPoint":25.41,"humidity":0.79,"windSpeed":8.42,"windBearing":92,"visibility":10,"cloudCover":0.87,"pressure":1034.66,"ozone":290.18},{"time":1418018400,"summary":"Drizzle in the morning.","icon":"rain","sunriseTime":1418044094,"sunsetTime":1418077829,"moonPhase":0.58,"precipIntensity":0.0015,"precipIntensityMax":0.0087,"precipIntensityMaxTime":1418050800,"precipProbability":0.25,"precipType":"rain","temperatureMin":31.12,"temperatureMinTime":1418036400,"temperatureMax":40.8,"temperatureMaxTime":1418072400,"apparentTemperatureMin":23.21,"apparentTemperatureMinTime":1418018400,"apparentTemperatureMax":34.56,"apparentTemperatureMaxTime":1418072400,"dewPoint":31.27,"humidity":0.87,"windSpeed":6.55,"windBearing":200,"visibility":9.72,"cloudCover":0.78,"pressure":1024.72,"ozone":285.93},{"time":1418104800,"summary":"Partly cloudy starting in the afternoon, continuing until evening.","icon":"partly-cloudy-day","sunriseTime":1418130545,"sunsetTime":1418164230,"moonPhase":0.61,"precipIntensity":0,"precipIntensityMax":0,"precipProbability":0,"temperatureMin":24.24,"temperatureMinTime":1418187600,"temperatureMax":33.27,"temperatureMaxTime":1418151600,"apparentTemperatureMin":15.78,"apparentTemperatureMinTime":1418187600,"apparentTemperatureMax":25.19,"apparentTemperatureMaxTime":1418151600,"dewPoint":23.24,"humidity":0.8,"windSpeed":8.31,"windBearing":332,"cloudCover":0.14,"pressure":1029.39,"ozone":292.05},{"time":1418191200,"summary":"Clear throughout the day.","icon":"clear-day","sunriseTime":1418216995,"sunsetTime":1418250632,"moonPhase":0.64,"precipIntensity":0,"precipIntensityMax":0,"precipProbability":0,"temperatureMin":21.76,"temperatureMinTime":1418209200,"temperatureMax":32.96,"temperatureMaxTime":1418241600,"apparentTemperatureMin":14.09,"apparentTemperatureMinTime":1418191200,"apparentTemperatureMax":32.96,"apparentTemperatureMaxTime":1418241600,"dewPoint":20.93,"humidity":0.78,"windSpeed":3.23,"windBearing":65,"cloudCover":0.02,"pressure":1030.07,"ozone":304.6},{"time":1418277600,"summary":"Clear throughout the day.","icon":"clear-day","sunriseTime":1418303444,"sunsetTime":1418337038,"moonPhase":0.67,"precipIntensity":0.0006,"precipIntensityMax":0.0011,"precipIntensityMaxTime":1418320800,"precipProbability":0.01,"precipType":"snow","precipAccumulation":0.133,"temperatureMin":23.78,"temperatureMinTime":1418295600,"temperatureMax":36.12,"temperatureMaxTime":1418328000,"apparentTemperatureMin":17.96,"apparentTemperatureMinTime":1418295600,"apparentTemperatureMax":30.77,"apparentTemperatureMaxTime":1418328000,"dewPoint":21.89,"humidity":0.73,"windSpeed":5.81,"windBearing":193,"cloudCover":0,"pressure":1025.89,"ozone":296.01},{"time":1418364000,"summary":"Partly cloudy overnight.","icon":"partly-cloudy-night","sunriseTime":1418389890,"sunsetTime":1418423445,"moonPhase":0.7,"precipIntensity":0,"precipIntensityMax":0,"precipProbability":0,"temperatureMin":27.87,"temperatureMinTime":1418382000,"temperatureMax":40.65,"temperatureMaxTime":1418414400,"apparentTemperatureMin":20.09,"apparentTemperatureMinTime":1418382000,"apparentTemperatureMax":36.16,"apparentTemperatureMaxTime":1418414400,"dewPoint":25.41,"humidity":0.71,"windSpeed":7.2,"windBearing":219,"cloudCover":0.04,"pressure":1024.69,"ozone":281.45}]},"alerts":[{"title":"Dense Fog Advisory for McLean, IL","time":1417791060,"expires":1417795200,"description":"...DENSE FOG ADVISORY NOW IN EFFECT UNTIL 10 AM CST THIS\nMORNING...\nTHE DENSE FOG ADVISORY IS NOW IN EFFECT UNTIL 10 AM CST THIS\nMORNING.\n* VISIBILITY...ONE QUARTER MILE. VISIBILITY WILL IMPROVE AS RAIN\nOVERSPREADS THE AREA.\n* IMPACTS...MOTORISTS WILL NEED TO SLOW DOWN...ALLOW EXTRA ROOM\nBETWEEN VEHICLES...AND PLAN FOR EXTRA TIME TO REACH THEIR\nDESTINATIONS.\n","uri":"http://alerts.weather.gov/cap/wwacapget.php?x=IL12517D60C60C.DenseFogAdvisory.12517D610040IL.ILXNPWILX.eebf0942a9b5bac557e0af034e6da74c"}],"flags":{"sources":["nwspa","isd","gfs","nearest-precip","fnmoc","cmc","sref","rtma","rap","nam","madis","lamp","darksky"],"isd-stations":["722171-04889","724397-54831","724397-99999","744672-04862","999999-14874"],"madis-stations":["AT380","AU670","C1740","C3379","C6473","D8284","D9546","D9547","D9553","D9668","D9761","E0890","IL023","KBMI","UP770","UP783"],"lamp-stations":["KAAA","KBMI","KPIA","KPNT"],"darksky-stations":["KILX"],"units":"us"}}';
答案 0 :(得分:3)
问题是因为JSON字符串包含" \ n"字符,因此解析器将字符串换行符转换为文字换行符。添加另一个反斜杠,如" \\ n"会给你预期的结果。