90nice
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <div>
        <p>点击下面的按钮可以将这段文字和图片分享到新浪微博哦!@独行冰海</p>
        <img src=\'http://t.cn/zRxMzZE\' title=\'独行冰海\'/>
        <input type="button" class="btn" id="btn" value=\'share\'>
    </div>
</body>
<script src=\'jquery.js\'></script>
<script>
    $(\'#btn\').click(function(){
        window.sharetitle = $(this).siblings(\'p\').html();
        window.shareUrl = $(this).siblings(\'img\').attr(\'src\');
        share();
    });
    function share(){
        //d指的是window
        (function(s,d,e){try{}catch(e){}var f=\'http://v.t.sina.com.cn/share/share.php?\',u=d.location.href,p=[\'url=\',e(u),\'&title=\',e(window.sharetitle),\'&appkey=2924220432\',\'&pic=\',e(window.shareUrl)].join(\'\');function a(){if(!window.open([f,p].join(\'\'),\'mb\',[\'toolbar=0,status=0,resizable=1,width=620,height=450,left=\',(s.width-620)/2,\',top=\',(s.height-450)/2].join(\'\')))u.href=[f,p].join(\'\');};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})(screen,document,encodeURIComponent);
    }
</script>
</html>

 

分类:

技术点:

相关文章:

  • 2021-11-17
  • 2021-11-17
  • 2021-07-12
  • 2021-11-17
  • 2021-11-17
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2021-11-17
  • 2021-10-28
  • 2021-11-17
相关资源
相似解决方案