我已将分享此按钮添加到我的安全网站,现在点击时会产生错误。错误如下所述。有没有人之前遇到过这个问题?
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?
阻止加载混合活动内容 w.sharethis/button/buttons.js
ReferenceError:未定义stLight
ReferenceError: stLight is not defined
在安全页面上加载混合(不安全)显示内容 http:/ /w.sharethis/images/facebook_32.png
Loading mixed (insecure) display content on a secure page "w.sharethis/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="ws.sharethis/button/buttons.js"></script> <script type="text/javascript"> stLight.options({ publisher:'12345', }); </script>同样适用于您的脸书图标。只需使用以下网址: ws.sharethis/images/facebook_32.png
Same applies to your facebook icon. Just use this URL: ws.sharethis/images/facebook_32.png
更多推荐
Share这个按钮在HTTPS网站上无法点击
发布评论