网站实现http跳转到https

2019-6-28 金莎网 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

Powered by emlog 京ICP备15030633号-2