157
rated 0 times
[
158]
[
1]
/ answers: 1 / hits: 23100
/ 8 Years ago, wed, november 2, 2016, 12:00:00
I am trying to use jQuery to check if URL is available or not. I am using the below Javascript code to verify this but it works for only HTTP URLs. If the URL is HTTPS it fails and I get the error alert
.
var backendUrl = https://myserver:8081/app/test.jsp;
$.ajax({
type: GET,
url: backendUrl
}).done(function (result) {
console.log(working);
window.location.href = backendUrl;
}).fail(function () {
alert(Sorry URL is not access able);
});
Can someone tell me a reason and some more precise way to check if URL is available or not using javascript.
More From » jquery