var ishttps = 'https:' == document.location.protocol ? true: false;
if(ishttps){
alert('https');
}else{
alert('http');
}
判断当前地址是http还是https
最新推荐文章于 2023-07-19 14:39:35 发布
var ishttps = 'https:' == document.location.protocol ? true: false;
if(ishttps){
alert('https');
}else{
alert('http');
}