I'm new to API, and I have watched couple tutorials on how can I use AJAX to call an API. I'm currently having an error on console when I call the function.
jquery.min.js:4 Mixed Content: The page at 'https://localhost:44399/Modules/EventManager' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://xxxx.xxxx.xxx:xxxx/GetLeaveBalance/2170'. This request has been blocked; the content must be served over HTTPS.
This API is provided by someone, so I have no control over it. My JS looks like this.
EventManager.GetLeaveBalance = function (idemployee) {
$.ajax({
url: "http://xxxx.xxxx.xxx:xx/GetLeaveBalance/" + idemployee,
type: "GET",
dataType: "json",
contentType: "application/json",
success: function (data) {
console.log(data);
}
});
}
But when I go to API url with supplied parameters directly from browser it works.