ShareThis buttons not clickable on HTTPS website

2019-04-30 07:05发布

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"

2条回答
Summer. ? 凉城
2楼-- · 2019-04-30 07:29

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

查看更多
混吃等死
3楼-- · 2019-04-30 07:32

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

查看更多
登录 后发表回答