最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Sharethis plugin not working with https: - Stack Overflow

programmeradmin0浏览0评论

I have changed my site domain from http:// to https:// and I have added sharethis plugin in my site.

It was working fine with http:// but now no buttons of share this displaying when I try to access my site using https://.

The following is the url of my site:

/

I have changed .js to .js and .js to .js.

But still it is showing error:

ReferenceError: sharethis is not defined

I have changed my site domain from http:// to https:// and I have added sharethis plugin in my site.

It was working fine with http:// but now no buttons of share this displaying when I try to access my site using https://.

The following is the url of my site:

https://www.placementbooster.ch/

I have changed http://w.sharethis.com/button/buttons.js to https://ws.sharethis.com/button/buttons.js and http://s.sharethis.com/loader.js to https://s.sharethis.com/loader.js.

But still it is showing error:

ReferenceError: sharethis is not defined

Share Improve this question edited Jan 19, 2018 at 19:01 Blue 22.9k7 gold badges66 silver badges98 bronze badges asked Nov 13, 2014 at 5:41 Gokul ShindeGokul Shinde 9653 gold badges10 silver badges30 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 10

Adapted from the docs:

https://support.sharethis.com/hc/en-us/articles/217916188-Moving-from-HTTP-to-HTTPS-SSL-Support

Regular ShareThis Script

<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script>
<script type="text/javascript">
stLight.options({
    publisher:'12345',
});
</script>

Secure ShareThis Script

<script type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>
<script type="text/javascript" src="https://ss.sharethis.com/loader.js"></script>
<script type="text/javascript">
stLight.options({
    publisher:'12345',
});
</script>

I'm using this code ant it is loading correctly without any mixed-content issues

I was getting "stLight" is not defined and found a blog post about moving to HTTPS. It basically says change "http://w" to "https://ws" and following it solved that problem. The post does have a link with "https://ss" in it. Perhaps you need to change "https://s" to "https://ss"?

<script type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>
<script type="text/javascript" src="https://ss.sharethis.com/loader.js"></script>
<script type="text/javascript">
stLight.options({
    publisher:'12345',
});
</script>

This has solved our issue.

发布评论

评论列表(0)

  1. 暂无评论