having difficulty parsing json alerts with java script US KS

  • 1
  • Problem
  • Updated 4 months ago
<h1>Watches and Warnings</h1>

<div id="watch">

<span id="wtype_meteoalarm_name"></span><br/>
<span id="description"></span><br/>
<span id="date"></span> <br/>
<span id="expires"></span><br/>
<span id="message"></span><br/>

</div>
<script type="text/javascript">
$.ajax({
  dataType: "json",
  url:"http://api.wunderground.com/api/key/forecast10day/conditions/alerts/lang:EN/q/39.55,-85...;,
  success: function(data){   
$('#city').html("City : " + data["alert"];
var NumElements = ArrayElements.length;
$('#type').html("Type : " + data["alert"]["type"]); 
$('#description').html("Description : " + data["alert"]["description"]);
$('#date').html("Date : " + data["alert"]["date"]); 
$('#expires').html("Expires : " + data["alert"]["expires"]); 
$('#message').html("Message : " + data["alert"]["message"]);
  }
});
</scriipt>
Photo of McLouth News

McLouth News

  • 2 Posts
  • 0 Reply Likes

Posted 4 months ago

  • 1

Be the first to post a reply!