通过一下方式可以判断当前页面是 http 还是 https
var ishttps = 'https:' == ? true: false;
if(ishttps){
alert("这是一个https请求");
}else{
alert(“这是一个http请求”);
}
通过一下方式可以判断当前页面是 http 还是 https
var ishttps = 'https:' == ? true: false;
if(ishttps){
alert("这是一个https请求");
}else{
alert(“这是一个http请求”);
}