美文网首页js
js实现http跳转https

js实现http跳转https

作者: 和光同尘_6990 | 来源:发表于2020-01-14 14:39 被阅读0次

    var targetProtocol = "https:";

    if (window.location.protocol != targetProtocol){

    window.location.href = targetProtocol +  window.location.href.substring(window.location.protocol.length);

    }

    相关文章

      网友评论

        本文标题:js实现http跳转https

        本文链接:https://www.haomeiwen.com/subject/lecaactx.html