我正在尝试让 Twitter 搜索小部件在我的 SSL 页面上运行,而浏览器不会发出未加密的警告。我已经搜索了一段时间,但找不到解决方案。有什么想法吗?
我试过以下方法: Including Twitter Widgets.js via HTTPS
我的代码如下
<script charset="utf-8" src="https://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'search',
search: 'Search term',
interval: 30000,
title: 'Twitter feed',
subject: 'WHatever',
width: 295,
height: 300,
theme: {
shell: {
background: 'transparent',
color: '#88afcc'
},
tweets: {
background: 'transparent',
color: '#cccccc',
links: '#1868e0'
}
},
features: {
scrollbar: false,
loop: true,
live: true,
behavior: 'default'
}
}).render().start();
</script>
我已经尝试将 widget.js 保存到我的服务器并以这种方式使用 https 调用它但无济于事,我也尝试再次将 widget.js 中所有出现的“http”更改为“https”但无济于事。
有什么想法吗?我真的很想将它保留在 SSL 页面上,但不会以用户认为我们与他们之间的连接不安全为代价。
最佳答案
将 widget.js 文件复制到您的 https 文件目录并更改您的 src 以指向它。
发生错误是因为 https 目录之外的任何文件都不会被 SSL 加密。
关于php - 通过 SSL 的 Twitter 搜索小部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10028742/