新浪微博:
<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) {
_url = encodeURI(_url.substr(0, _url.indexOf('#')));
} else {
_url = encodeURI(_url);
}
var _appkey = encodeURI("9be94cd5b89f42e2a2214ebd d33aafe8");
var _u = 'http://v.t.qq.com/share/share.php?title='+_t+'&url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic;
window.open( _u,'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
return false;
}
<a class="msn" οnclick="posttoWb();" style="cursor:pointer;"><img src="/resources/tqq.gif"/>腾讯微博</a>
<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() {
<a class="msn" οnclick="posttoWb();" style="cursor:pointer;"><img src="/resources/tqq.gif"/>腾讯微博</a>