HTTP協議改HTTPS


//獲取源機器的協議

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;
    }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM