Some Useful tiny JavaScript functions
Force HTTPS in JavaScript We can use JavaScript to check if the users are on a secure (HTTPS) page and redirect them to the HTTPS equivalent of the current page if they are not on one, at the moment. toHttps: function() { if (window.location.href.indexOf(“https://”) === -1) { window.location = “https://” + window.location.hostname + window.location.pathname + […]