问题描述
我已将分享此按钮添加到我的安全网站,现在点击时会产生错误。错误如下所述。有没有人之前遇到过这个问题?
I have added "share this" buttons to my secure site and now they produce an error when clicked. Errors are mentioned below. Has anyone had this problem before?
ReferenceError:未定义stLight
ReferenceError: stLight is not defined
在安全页面上加载混合(不安全)显示内容
Loading mixed (insecure) display content on a secure page "http://w.sharethis.com/images/facebook_32.png"
推荐答案
基本上,如果页面是通过HTTPS加载的,那么它所使用的每个资源也应该通过HTTPS加载。它是浏览器安全策略的一部分,就像等。
Basically if a page is loaded over HTTPS then every resource it uses should also be loaded over HTTPS. It's a part of browser security policy, just like Same-Origin Policy etc.
幸运的是,ShareThis可以通过HTTPS使用,如下所示:
Fortunately ShareThis can be used over HTTPS like this:
<script type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">
stLight.options({
publisher:'12345',
});
</script>
同样适用于您的脸书图标。只需使用以下网址: https://ws.sharethis.com/images/facebook_32.png
Same applies to your facebook icon. Just use this URL: https://ws.sharethis.com/images/facebook_32.png
这篇关于Share这个按钮在HTTPS网站上无法点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!