网站实现http跳转到https JavaScript

<script type="text/javascript">
var targetProtocol = "https:";
if (window.location.protocol != targetProtocol)
 window.location.href = targetProtocol +
  window.location.href.substring(window.location.protocol.length);
</script>

 
标签: 实例 js

金莎网 发布于 2019-6-28 18:36