”`markdown# 915网站导航

这是一个用于帮助用户在915网站(https://www.915.com)上进行页面跳转的网站导航工具。当用户的浏览器地址栏显示的协议为”http:“时,该工具会自动将其转换为”https:“,以便用户可以直接访问915网站的”https”版本,提高安全性和用户体验。

主要功能

##使用方法

将此JavaScript代码添加到您的网页中,即可实现上述功能。具体操作如下:

  1. 将以下代码复制到一个名为tmpTag.js的文件中:
function tmpTag() {
var tmpTag = 'https:' == document.location.protocol ? false : true;
var urls=window.location.href;
if(tmpTag){ console.log(11); var http915 = /http:\/\/915/; if(http915.test(urls)){ urls = urls.replace("http://915", "https://915"); window.location=urls; } var www915 = /http:\/\/www.915/; if(www915.test(urls)){ urls = urls.replace("http://www.915", "https://www.915"); window.location=urls; } }else { console.log(22); var https915 = /https:\/\/915/; if(http915.test(urls)){ urls = urls.replace("http://915", "https://915"); window.location=urls; } }
}
tmpTag();
  1. 在HTML文件中的<head>标签内添加以下代码,引入tmpTag.js文件:
<script src="tmpTag.js"></script>

完成以上步骤后,当用户访问您的网站并且其浏览器地址栏显示为”http:“时,页面将自动跳转至对应的”https:“版本。