解决百度分享不支持HTTPS的问题

主要内容来自:https://www.hrwhisper.me/baidu-share-not-support-https-solution/,站点自从开启 https 之后 ,百度分享就不能用了!但是又寻找不到类似百度分享的替代品。怎么办呢?要如何解决 百度分享不支持https的问题呢,

一、下载文件

下载地址:https://github.com/hrwhisper/baiduShare   怎么下载:Clone or download--->Download ZIP 即可

如何下载

二、解压文件到根目录

static 解压后丢到站点的根目录

解压到根目录

三、修改代码

然后对应的百度分享代码中,把

.src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>

改为

.src='/static/api/js/share.js?v=89860593.js?'];</script>

不想改的,就直接复制下我的:

<!--调用分享代码-->
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more">分享到:</a>
<a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间">QQ空间</a>
<a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博">新浪微博</a>
<a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信">微信</a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"1","bdSize":"24"},"share":{"bdSize":24}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='/static/api/js/share.js?v=89860593.js?'];</script>

THE END
打赏
海报
解决百度分享不支持HTTPS的问题
主要内容来自:https://www.hrwhisper.me/baidu-share-not-support-https-solution/,站点自从开启 https 之后 ,百度分享就不能用了!但是又寻找不到类似百度分享的替代品。怎么办呢?要如何解决 百度分享不……
<<上一篇
下一篇>>