I have a website where I want to display a link ONLY for users inside our local corporate network.
Therefore I have to detect this using Javascript.
I've tried to "ping" a test website hosted on one of our local IIS server with Ajax, but my website is using HTTPS so it does not work (as it seems impossible to issue a SSL certificate for a local server) as all recent browsers raise a "ERR_CERT_AUTHORITY_INVALID" error.
Does anyboby have a clue or an idea on how I can do that?
Here is my current test (which does not work...)
$.ajax({
type: "GET",
url: "https://my-local-website.com",
timeout: 3000,
jsonp: "jsonp",
success: function (response, textS, xhr) {
$('body').html('true');
},
error: function (xmlHttpRequest, textStatus, errorThrown) {
$('body').html('false');
}
});