如何获取json值并在javascript中解析并输出到html
$.getJSON(
{
"current_observation": {
"credit": "Weather Underground NOAA Weather Station",
"credit_URL": "wunderground.com/",
"termsofservice": {
"-link": "wunderground.com/weather/api/d/terms.html",
"#text": "
This feed will be deprecated. Please switch to wunderground.com/weather/api/
"
},
"image": {
"url": "
http://icons-ak.wxug.com/graphics/wu2/logo_130x80.png
",
"title": "Weather Underground",
"link": "http://wunderground.com/"
},
"display_location": {
"full": "Chetput, India",
"city": "Chetput",
"state_name": "India",
"country": "IN",
"country_iso3166": "IN",
"zip": "00000",
"latitude": "13.060420",
"longitude": "80.249580",
"elevation": "11.00000000 ft"
},
"observation_location": {
"full": "Chennai,",
"city": "Chennai",
"country": "IN",
"country_iso3166": "IN",
"latitude": "13.00000000",
"longitude": "80.18000031",
"elevation": "52 ft"
},
"station_id": "VOMM",
"observation_time": "Last Updated on December 11, 4:10 PM IST",
"observation_time_rfc822": "Tue, 11 Dec 2012 10:40:00 GMT",
"observation_epoch": "1355222400",
"local_time": "December 11, 4:43 PM IST",
"local_time_rfc822": "Tue, 11 Dec 2012 11:13:29 GMT",
"local_epoch": "1355224409",
"weather": "Partly Cloudy",
"temperature_string": "84 F (29 C)",
"temp_f": "84",
"temp_c": "29",
"relative_humidity": "62%",
"wind_string": "From the ESE at 7 MPH",
"wind_dir": "ESE",
"wind_degrees": "110",
"wind_mph": "7",
"pressure_string": "29.83 in (1010 mb)",
"pressure_mb": "1010",
"pressure_in": "29.83",
"dewpoint_string": "70 F (21 C)",
"dewpoint_f": "70",
"dewpoint_c": "21",
"heat_index_string": "88 F (31 C)",
"heat_index_f": "88",
"heat_index_c": "31",
"windchill_string": "NA",
"windchill_f": "NA",
"windchill_c": "NA",
"visibility_mi": "5.0",
"visibility_km": "8.0",
"icons": {
"icon_set": [
{
"-name": "Default",
"icon_url": "http://icons-ak.wxug.com/i/c/a/partlycloudy.gif"
},
{
"-name": "Smiley",
"icon_url": "http://icons-ak.wxug.com/i/c/b/partlycloudy.gif"
},
{
"-name": "Generic",
"icon_url": "http://icons-ak.wxug.com/i/c/c/partlycloudy.gif"
},
{
"-name": "Old School",
"icon_url": "http://icons-ak.wxug.com/i/c/d/partlycloudy.gif"
},
{
"-name": "Cartoon",
"icon_url": "http://icons-ak.wxug.com/i/c/e/partlycloudy.gif"
},
{
"-name": "Mobile",
"icon_url": "http://icons-ak.wxug.com/i/c/f/partlycloudy.gif"
},
{
"-name": "Simple",
"icon_url": "http://icons-ak.wxug.com/i/c/g/partlycloudy.gif"
},
{
"-name": "Contemporary",
"icon_url": "http://icons-ak.wxug.com/i/c/h/partlycloudy.gif"
},
{
"-name": "Helen",
"icon_url": "http://icons-ak.wxug.com/i/c/i/partlycloudy.gif"
},
{
"-name": "Incredible",
"icon_url": "http://icons-ak.wxug.com/i/c/k/partlycloudy.gif"
}
]
},
"icon_url_base": "http://icons-ak.wxug.com/graphics/conds/",
"icon_url_name": ".GIF",
"icon": "partlycloudy",
"forecast_url": "
http://www.wunderground.com/global/stations/43278.html
",
"history_url": "
wunderground.com/history/airport/VOMM/2012/12/11/DailyHistory.html
",
"ob_url": "
wunderground.com/cgi-bin/findweather/getForecast?query=13.00000000,80.18000031"
}
});