百度分享和https冲突

解决方案:https://themebetter.com/baidushare-https.html

1、从百度分享获取代码。

<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a></div>

<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=8986888.js?cdnversion='+~(-new Date()/36e5)];</script>

2、下载上方网址里面文件,上传到网站根目录。static/api/

3、将 1 获取代码里面的 http://bdimg.share.baidu.com,修改为 src='static/api/js/share。。。。,或换成自己域名就好。 src='https://www.xxxxx.com/static/api/js/share。。

posted on 2018-03-06 15:51  longlongcheng  阅读(206)  评论(0编辑  收藏  举报

导航