dennysong

//获取源机器的协议

string protocol = Request.Url.AbsoluteUri.ToLower().IndexOf("https") != -1 ? "https://" : "http://";

//获取绝对路径

function getAbsoluteUrl(url) {
    var a = document.createElement(\'A\');
    a.href = url; 
    url = a.href;  
    if (url.indexOf(\'/player/video.aspx\') != -1) {
        return url.toLowerCase().replace("https", "http");
    }
    return url;
}

//替换http为https

function getprotocol(url) {
    var ishttps = \'https:\' == document.location.protocol ? true : false;
    if (ishttps) {
        return url.replace("http://", "https://");
    } else {
        return url;
    }
}

 

分类:

技术点:

相关文章:

  • 2021-05-21
  • 2021-06-27
  • 2021-11-20
  • 2021-08-21
  • 2021-04-16
  • 2021-09-03
猜你喜欢
  • 2021-11-17
  • 2021-11-29
  • 2022-12-23
  • 2021-08-17
  • 2022-01-10
  • 2021-09-17
  • 2021-05-24
相关资源
相似解决方案