ShareThis buttons not clickable on HTTPS website

时光怂恿深爱的人放手 提交于 2019-12-07 05:42:08

问题


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?

Blocked loading mixed active content "http://w.sharethis.com/button/buttons.js"

ReferenceError: stLight is not defined

Loading mixed (insecure) display content on a secure page "http://w.sharethis.com/images/facebook_32.png"


回答1:


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.

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>

Same applies to your facebook icon. Just use this URL: https://ws.sharethis.com/images/facebook_32.png




回答2:


Also for those that are having trouble debugging this stuff make sure to check out that your browsers aren't blocking ShareThis through an add-on.

Ref: stLight not defined issue related to addons



来源:https://stackoverflow.com/questions/21118191/sharethis-buttons-not-clickable-on-https-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!