HTML로 바이두 공유 플러그인 공유 웹 페이지 구현

4305 단어
1. HTML 코드는 다음과 같습니다.
<div class="bdsharebuttonbox">
        <a href="#" class="bds_more" data-cmd="more">a>
        <a href="#" class="bds_qzone" data-cmd="qzone">a>
        <a href="#" class="bds_tsina" data-cmd="tsina">a>
        <a href="#" class="bds_tqq" data-cmd="tqq">a>
        <a href="#" class="bds_renren" data-cmd="renren">a>
        <a href="#" class="bds_weixin" data-cmd="weixin">a>
    div>

2. 자바스크립트 코드는 다음과 같습니다.
<span style="color: #000000;">
    window._bd_share_config</span>={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdPic":"","bdStyle":"0","bdSize":"16"},"share":{},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"   :","viewSize":"16"},"selectShare":{"bdContainerClass":<span style="color: #0000ff;">null</span>,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"<span style="color: #000000;">]}};
    </span><span style="color: #0000ff;">with</span>(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-<span style="color: #0000ff;">new</span> Date()/36e5)];

좋은 웹페이지 즐겨찾기