I have a JSON url file, which I have grabbed the data from and wrote out to an li. The link to the JSON file is https://www.inquicker.com/facility/americas-family-doctors.json. The link to my fiddle file is http://jsfiddle.net/VVnSC/17/. I am trying to narrow down the times to the Next Available time for each location. So I only have 1 time (the next available time) for each location Brentwood, Smyrna, and Spring Hill. I am also trying to get rid of the Location name before the dash in the name so it just displays the person's name. All help will be greatly appreciated, Thanks.
<!DOCTYPE html>
<html>
<head>
<title>AFD TEST</title>
<script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"> </script>
<script>
$(document).ready(function(){
$.getJSON('https://www.inquicker.com/facility/americas-family-doctors.json',
function(data){
console.log(data.facility);
$.each(data.schedules, function(i, name){
times=''
if (name.available_times.length){
times='<ul>'
$.each(name.available_times,function(i,o){
for (var i; i < 1; i++) {
times+='<li><a href="'+ name.available_times[0].url +'">'+o.when+'</a></li>'
}
})
times+='</ul>'
}
else{
times='<ul><li>No Time Available</li></ul>'
}
$('#names').append('<li>' + (name.name) + times + '</li>');
});
});
});
</script>
</head>
<body>
<ul id="names"></ul>
</body>
</html>