阅读量:131

使用JavaScript对https进行判断,具体方法如下:
var ishttps = 'https:' == [removed].protocol ? true: false;
if(ishttps){
alert("这是一个https请求");
}else{
alert(“这是一个http请求”);
}

使用JavaScript对https进行判断,具体方法如下:
var ishttps = 'https:' == [removed].protocol ? true: false;
if(ishttps){
alert("这是一个https请求");
}else{
alert(“这是一个http请求”);
}