绑定到新浪微博,腾讯微博JS代码
来源:互联网 发布:淘宝权重都有哪些 编辑:程序博客网 时间:2024/05/11 09:16
新浪微博:
<a class="ren" href="javascript:(function(){window.open('http://v.t.sina.com.cn/share/share.php?appkey=你的APPKEY&title='+encodeURIComponent('分享的内容')+'&url='+encodeURIComponent(location.href),'_blank','width=440,height=430');})()"><img src="/themes/default/images/ico_sina.gif"/>新浪微博</a>
腾讯微博:
function posttoWb() {
var _t = $('.CDHead h2').html();
if($('.CDContent p').html()){
_t = $('.CDHead h2').html()+$('.CDContent p').html().replace(/<[^>]*>/g,'');
}
if (_t.indexOf('#') > 0) {
_t = encodeURI(_t.substr(0, document.title.indexOf('#')).replace(/\_[\u4E00-\u9FA5]+\_腾讯网/g, ''));
} else {
_t = encodeURI(_t.replace(/\_[\u4E00-\u9FA5]+\_腾讯网/g, ''));
}
var _source = 1000041;
var _site = encodeURI('<a href="$db_bbsurl">$db_bbsname</a>');
var _pic = '';
var img = document.getElementsByTagName_r("img");
for (var i = 0; i < img.length; i++) {
_pic += img.src + "|";
}
var _url = encodeURI(window.location.href);
if (_url.indexOf('#') > 0) {
<a class="ren" href="javascript:(function(){window.open('http://v.t.sina.com.cn/share/share.php?appkey=你的APPKEY&title='+encodeURIComponent('分享的内容')+'&url='+encodeURIComponent(location.href),'_blank','width=440,height=430');})()"><img src="/themes/default/images/ico_sina.gif"/>新浪微博</a>
腾讯微博:
function posttoWb() {