Is there any way to detect HTTP or HTTPS and then force usage of HTTPS with JavaScript?
I have some codes for detecting the HTTP or HTTPS but I can't force it to use https:
.
I'm using the window.location.protocol property to set whatever the site is to https:
then refresh the page to hopefully reload a new https'ed URL loaded into the browser.
if (window.location.protocol != "https:") {
window.location.protocol = "https:";
window.location.reload();
}