My index.html has this code to select the better destination server to connect:
<html>
<head>
<title>InterSite Sistemas Ltda - SITESAT</title>
<script language="JavaScript" src="https://localhost/js/functions.js"></script>
</head>
<body onload="loginLoadBalancer('https://localhost/webservicelb')">
Loading...
</body>
</html>
And the functions.js has this code:
function loginLoadBalancer(url) {
var req = new XMLHttpRequest();
req.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
window.location.replace(this.responseText);
}
};
req.open("GET", url, true);
req.send(null);
}
The webservicelb looks for the better server and returns the URL to redirect.
When I call https://localhost/ all works fine. But, if I use http://localhost/, JS doesn't run, the index.html freezes in "Loading...". Is there some way to allow JS to process https requests from a http page?