2012-06-01 29 views
2

我使用jQuery的主題輥在我的項目的問題,我已經注意到,它是創建一個Chrome的警告:jQuery的ThemeSwitcher與HTTPS

The page at https://mysite/ displayed insecure content from http://static.jquery.com/ui/themeroller/images/themeGallery/theme_90_dark_hive.png. 

和最差的,它使「綠色旗幟」(安全現場)再次變白。

所以,我研究我發現這個問題的根源是jquery.ui.themeswitcher.js其具有與非SSL URL變量:

imgPrefix:"http://static.jquery.com/ui/themeroller/images/themeGallery/theme_90_", 

如果我更改爲「https」這些圖像沒有加載(事實上,似乎這個協議沒有啓用)。所以問題是:是否有任何啓用了HTTPS的網站可以獲取這些文件?

回答

1

我有類似的錯誤,所以我下載的JS從http://jqueryui.com/themeroller/themeswitchertool/,它保存爲jquery.themeswitcher.js,取而代之的是谷歌API的HTTPS URL中的所有HTTP jQuery的用戶界面的網址。

唯一的變化是在var switcherpane其中每個環節的樣子:

<li><a href= 
"http://jqueryui.com/themeroller/css/parseTheme.css.php?...."> 
<img src= 
"http://jqueryui.com/themeroller/images/themeGallery/theme_90_ui_dark.png" alt= 
"UI Darkness" title="UI Darkness" /> <span class="themeName">UI 
darkness</span></a></li> 

我與替換:

<li><a href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/ui-lightness/jquery-ui.css"> 
<img src="content/images/theme_90_ui_light.png" alt="UI Lightness" title= 
"UI Lightness" /><span class="themeName">UI lightness</span></a></li> 

如果整個文件中搜索也有一些其他的HTML圖像那些被進一步引用。

你可以找到here

0

你可以簡單地設置src鏈接爲「https」,它會正常工作的所有圖像。

<link rel="stylesheet" href="themes/MyTheme.min.css" /> 
<link rel="stylesheet" href="themes/jquery.mobile.icons.min.css" /> 
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.1/jquery.mobile.structure-1.4.1.min.css" />  
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>  
<script src="https://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.js"></script>