js获取网页请求类型是http还是https
var ishttps = 'https:' == document.location.protocol ? true : false;
if(ishttps) {
alert("这是一个https请求");
} else {
alert("http");
}js取得域名
//取得当前域名 没有带http:// var host = document.domain; console.log(host);
js取得当前链接
console.log(location.href);
站长微信:xiaomao0055
站长QQ:14496453