您的位置:首页 > 编程语言

微博分享代码

2012-01-11 14:36 204 查看
<!--[if IE 6]>
<style type="text/css">
#fixed{display:none;}
</style>
<![endif]-->
<div id="fixed" name="fixed" style=" position:fixed; top:330px; left:3px; ">
<a href="javascript:void(0)" onclick="postToWb();"  class="tmblog">
<img src="http://v.t.qq.com/share/images/s/weiboicon24.png" alt ="分享到腾讯微博" style=" border:none;  margin-right:10px; " /></a>
<script type="text/javascript">
function postToWb() {
var _t = encodeURI(document.title);
var _url = encodeURIComponent(document.location);
var _appkey = encodeURI("appkey"); //你从腾讯获得的appkey
var _pic = encodeURI(''); //(例如:var _pic='图片url1|图片url2|图片url3....)
var _site = ''; //你的网站地址
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');
}
</script>
<script type="text/javascript" charset="utf-8">
(function () {
var _w = 90, _h = 24;
var param = {
url: location.href,
type: '2',
count: '1', /**是否显示分享数,1显示(可选)*/
appkey: '', /**您申请的应用appkey,显示分享来源(可选)*/
title: '', /**分享的文字内容(可选,默认为所在页面的title)*/
pic: '', /**分享图片的路径(可选)*/
ralateUid: '1909664830', /**关联用户的UID,分享微博会@该用户(可选)*/
language: 'zh_cn', /**设置语言,zh_cn|zh_tw(可选)*/
rnd: new Date().valueOf()
}
var temp = [];
for (var p in param) {
temp.push(p + '=' + encodeURIComponent(param[p] || ''))
}
document.write('<iframe allowTransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + '" width="' + _w + '" height="' + _h + '"></iframe>')
})()
</script>
<br />
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=80455399&site=qq&menu=yes" >
<img border="0" src="http://wpa.qq.com/pa?p=2:80455399:50" alt="点击这里给我发消息" title="点击这里给我发消息" />
</a>
</div>



效果图
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息