having difficulty parsing json alerts with java script

  • 1
  • Problem
  • Updated 3 years ago

I'm using the javascript bellow on conditions and it works great. but when attempting with alerts I get "undefined"? The only thing I can get to work is "query_zone". I tested with a city that actually has an alert listed. Not sure what I'm doing wrong?

jQuery(document).ready(function ($) { $.ajax({ url: "http://api.wunderground.com/api/key/alerts/q/oh/cleveland.json";, dataType: "jsonp", success: function (parsed_json) { var description = (parsed_json)['description']; var expires = (parsed_json)('expires'); document.getElementById('alert1').innerHTML = (description); document.getElementById('alert2').innerHTML = (expires); } }); });

Photo of dennisman80


  • 2 Posts
  • 0 Reply Likes

Posted 3 years ago

  • 1

Be the first to post a reply!