新浪微博分享接口(网页版)

1、JS

<script type="text/javascript">
        function Tosinaweibo() {
            var PicURL = document.getElementById('img1').src;
            // var _t = encodeURI(document.title);
            var _t = encodeURI("您也来参与一下,一起为中国奥运健儿加油吧!");
            // var _url = encodeURIComponent(document.location);
            //var _url = encodeURIComponent("http://www.xxxx.com");
            var _appkey = encodeURI("333333"); //你从微薄获得的appkey
            var _pic = PicURL;
            var _site = ''; //你的网站地址
            var _u = ' http://service.weibo.com/share/share.php?pic=' + _pic + '&appkey=' + _appkey + '&title=' + _t;
            window.open(_u, '', 'width=600, height=450, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
        }
</script>

 

2、HTML

<input id="Button2" type="button" value="一键分享" onclick="javascript:Tosinaweibo();" />

 

posted on 2012-08-06 13:31  王阿冰  阅读(461)  评论(0编辑  收藏  举报

导航