<a id="shareBtn" href="javascript:void(0)" target="_blank">自定义新浪微博分享按钮样式</a>
<script>
function weiboShare() {
var wb_shareBtn = document.getElementById("shareBtn"),
wb_url = document.URL, //获取当前页面地址,也可自定义例:wb_url = "http://liuyanzhao.com"
count = '', //表示是否显示当前页面被分享数量(1显示)(可选,允许为空)
wb_appkey = "1368663223", //用于发布微博的来源显示,为空则分享的内容来源会显示来自互联网。(可选,允许为空)
wb_title = "分享内容介绍", //分享时所示的文字内容,为空则自动抓取分享页面的title值(可选,允许为空)
wb_ralateUid = "高阳刘", //转发时会@相关的微博账号(可选,允许为空)
wb_pic = "", //自定义图片地址,作为微博配图(可选,允许为空)
wb_language = "zh_cn"; // 语言设置(zh_cn|zh_tw)(可选)
wb_shareBtn.setAttribute("href", "http://service.weibo.com/share/share.php
?url=" + wb_url + "&appkey=" + wb_appkey + "&title=" + wb_title + "&pic=" +
wb_pic + "&ralateUid=" + wb_ralateUid + "&language=" + wb_language +
"&count=" + count);
}
weiboShare();
</script>
网友评论