I am very new to jQuery
and json
. I am trying to get UK Bank Holiday data from the following API/link so that I can create a function which determines if a selected date is a working day.
https://www.gov.uk/bank-holidays.json
I had an error for No Transport
which I fixed by putting in:
jQuery.support.cors = true;
I am now getting Access Denied
. I have no idea how to gain access to this because as I say, I am still learning all this.
function IsWorkingDay(date) {
var day = new moment(value, "DD-MM-YYYY").day();
jQuery.support.cors = true;
var bankHolidays = $.getJSON("https://www.gov.uk/bank-holidays.json").done(function(data) {
alert(data);
})
.fail(function(a, b, c) {
alert(b + ',' + c);
return day != 0 && day != 6;
}
});
My question is in two phases:
- How do I get access? (Main question)
- How do I move on to access the data? I have downloaded the
json
onto my computer to look at, just how I am going to go about translating this tojavascript
is what I am struggling on.