2016-11-24 60 views

回答

0

記住將每個鏈接轉換爲javascript'location.href'。

如果您有jQuery的(好老朋友;)),你正在使用的錨絕對鏈接,你可以用:

$(document).on("click","a[href]", function(e){ 
    e.stopPropagation(); 
    window.location.href = $(this).attr("href"); 
}); 

這將設置此beavior所有的鏈接...

0

固定。

以下代碼是存在於與重定向用戶的向右協議目標(http或SSL)應用:

if (document.URL.indexOf('http://') === -1 && document.URL.indexOf('https://') === -1) { 
    // PhoneGap application 
} else { 
    if (location.protocol != 'https:') {location.href = 'https:' + window.location.href.substring(window.location.protocol.length);} 
} 

if (location.protocol != 'https:') {location.href = 'https:' + window.location.href.substring(window.location.protocol.length);} 

替換爲

相關問題