js实现http跳转https
2020-01-14 本文已影响0人
和光同尘_6990
var targetProtocol = "https:";
if (window.location.protocol != targetProtocol){
window.location.href = targetProtocol + window.location.href.substring(window.location.protocol.length);
}
var targetProtocol = "https:";
if (window.location.protocol != targetProtocol){
window.location.href = targetProtocol + window.location.href.substring(window.location.protocol.length);
}