2014-03-05 25 views
0

我們爲我們的網站部署了新的SSL證書。 我們已經注意到,如果'https'帶有前綴,那麼動態網頁不會被加載(來自mysql數據庫的數據),同時如果我們打開網頁而沒有https頁面加載正確(來自mysql數據庫的數據正在被拉和顯示)。如果在url中使用https,動態網頁內容不會出現

With 'https' 

https://somedomain.com/display.php?pageid=9 


Without 'https' (plain http) 

http://somedomain/display.php?pageid=9 

可能是什麼問題?

回答

1

問題是,無法加載jquery庫,因爲它使用http而不是https,因此您的客戶端代碼都不工作。

從螢火蟲:

Blocked loading mixed active content "http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" 

你應該以https加載jquery的這樣:

https://ajax.googleapis.com/ajax/libs/jquery/1.4.3 

或者這樣:

//ajax.googleapis.com/ajax/libs/jquery/1.4.3 

,並根據它訪問了哪些協議的頁面它會通過http或https加載庫。

一般而言,一旦切換到https,您應該通過https加載所有腳本,否則它們將被視爲安全漏洞而被阻止。

您可以在這裏瞭解更多:Why am I suddenly getting a "Blocked loading mixed active content" issue in Firefox?

+0

或// AJA .....,因此訪問的URL將設置正確的選項。 –

+0

在@NeilMasters聲明中進行擴展:使用'// ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'來代替,因爲Web瀏覽器會將其默認爲訪問您的網頁時使用的協議 – MonkeyZeus