我在项目中使用了 jquery 主题滚轮,我注意到它正在创建一个 Chrome 警告:
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”,则不会加载图像(事实上,似乎没有启用该协议(protocol))。所以问题是:是否有任何启用 HTTPS 的网站可以获取这些文件?
最佳答案
我遇到了类似的错误,所以我从http://jqueryui.com/themeroller/themeswitchertool/下载了js ,将其保存为 jquery.themeswitcher.js 并将所有 http jquery-ui url 替换为 google apis https url。
唯一的变化是在 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
关于jquery ThemeSwitcher 在 HTTPS 方面存在问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10854736/