The problem is that I can not retrieve the results of a .json file
that I am accessing on a secured server, but this only happens when using ANY version of IE web browser.
Firefox and Chrome work well with no console errors reported when retrieving data.
Since this is only an IE issue, I am wondering the best method to retrieve the .json file
so I can then parse the contents of the received data. Thoughts?
Here's the code:
<!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 type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js"></script>
<script>
$(document).ready(function(){
$.getJSON('https://www.inquicker.com/facility/americas-family-doctors.json',
function(data){
var earliest = {};
var doctor = {};
var links = {};
$.each(data.schedules, function(i, name) {
var location = name.name.split(' - ')[0];
var dr_name = name.name.split(' - ')[1];
if (name.available_times.length) {
if (location in earliest) { // location has already been stored.
var newTime = parseAvailableDate(name.available_times[0].when);
if (newTime.isBefore(earliest[location])) {
earliest[location] = newTime;
doctor[location] = dr_name;
links[location] = name.available_times[0].url;
}
}
else {
earliest[location] = parseAvailableDate(name.available_times[0].when);
doctor[location] = dr_name;
links[location] = name.available_times[0].url;
}
}
});
displayDetailsBrentwood("Brentwood", earliest, doctor, links);
displayDetailsSmyrna("Smyrna", earliest, doctor, links);
displayDetailsSpring("Spring Hill", earliest, doctor, links);
});
});
function parseAvailableDate(dateString) {
var trimmedString = dateString.replace(/^\s\s*/, '');
var avTime=trimmedString.split(' ')[0],
ampm=trimmedString.split(' ')[1],
avDay=trimmedString.split(' ')[2];
var avDate = Date.parse("next "+avDay);
avDate.addHours(avTime.split(':')[0]).addMinutes(avTime.split(':')[1]);
if (ampm == "pm" && avTime.split(':')[0] != "12") avDate.addHours(12);
return avDate;
}
function displayDetailsBrentwood(location, earliest, doctor, links) {
$("#brentwood").append("<ul><a href='"+links[location]+"'>"+earliest[location].toString("MM/dd/yyyy h:mm tt")+"</a></ul>");
}
function displayDetailsSmyrna(location, earliest, doctor, links) {
$("#smyrna").append("<ul><a href='"+links[location]+"'>"+earliest[location].toString("MM/dd/yyyy h:mm tt")+"</a></ul>");
}
function displayDetailsSpring(location, earliest, doctor, links) {
$("#spring_hill").append("<ul><a href='"+links[location]+"'>"+earliest[location].toString("MM/dd/yyyy h:mm tt")+"</a></ul>");
}
</script>
</head>
<body>
<ul id="brentwood"></ul>
<ul id="smyrna"></ul>
<ul id="spring_hill"></ul>
</body>
</html>