js

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);

}

上一篇下一篇

猜你喜欢

热点阅读