Home > Article > Web Front-end > Detailed explanation of using Baidu sharing examples on HTTPS pages
Since the full site https access was enabled, the shared code has been unavailable, and the small green mark has become a gray mark. Alas, I have worked hard for this little green label. Baidu ads have basically been removed, Baidu site search is basically useless, and the sharing function is just a decoration. Some fellow researchers asked me, why can’t I share it? In fact, it’s not that I don’t want to share, it’s just that my ability is limited and I can’t solve this problem. I just have free time today and am ready to solve this sharing problem.
Solution
The solution comes from Whispering Whispers. Please note that the website may be blocked and requires a proxy. The code is shared on Gihhub.
The general solution is to change Baidu's sharing code to local code, so that there is no need to call Baidu's sharing code through the http channel every time. The code can be downloaded on github.
After decompressing, just drop static into the root directory of the site.
Related file download address:
http://bdimg.share.baidu.com/Changed to/Github address: https://github.com/hrwhisper/baiduShare
Or click here to download
Download and unzip to get the static folder
Then modify the js we quoted
Modify to:
.src='https://www.xxx.cn/inc/uploads/online/static/api/js/share.js?v=89860593. js?cdnversion='+~(-new Date()/36e5)];
Please change the domain name to your own. OK, problem solved. 100% sharing appears again!
Related recommendations:
The use of Baidu share button in the project, Baidu share button project_PHP tutorial
Using Baidu on the mobile terminal Share code_html/css_WEB-ITnose
The use of Baidu share button in the project, Baidu share button project_PHP tutorial
The above is the detailed content of Detailed explanation of using Baidu sharing examples on HTTPS pages. For more information, please follow other related articles on the PHP Chinese website!