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

java 博客分享实现--facebook--linkein

2015-04-08 15:32 253 查看
<!doctype html>

<html>

<head>
<meta charset="UTF-8">
<title>Document</title>

</head>

<body>
<div>
<p id="p1">点击下面的按钮可以将这段文字和图片分享到新浪微博哦!@飞鱼</p>
<img src='http://xinji1101.sinaapp.com/b.jpg'/>
<input type="button" class="btn" id="btn" value='share'>
</div>

</body>

<script src='jquery-1.9.1.js'></script>

<script>
$('#btn').click(function(){
window.sharetitle = $(this).siblings('#p1').html();
window.shareUrl = $(this).siblings('img').attr('src');
share();
});
function share(){
//d指的是window
(function(s,d,e){try{}catch(e){}var f='http://v.t.sina.com.cn/share/share.php?',u=d.location.href,p=['url=',e(u),'&title=',e(window.sharetitle),'&appkey=2924220432','&pic=',e(window.shareUrl)].join('');function a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=620,height=450,left=',(s.width-620)/2,',top=',(s.height-450)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})(screen,document,encodeURIComponent);
}
function test(){
var abc = [1,3,5].join('');
alert(abc);
}
test();

</script>
</html> 

2

<a class="fb_t" href="javascript: void(window.open('http://www.facebook.com/share.php?u='.concat(encodeURIComponent(location.href)) ))"title="share to Facebook" rel="nofollow">Facebook</a></div>

3

 <a href='https://www.linkedin.com/shareArticle?mini=true&title=baidushare&url=http://www.baidu.com&summary=undefined&source=ProgrammableWe3b'>linked in 2</a>

4 facebook

4 wtitter

<a href="http://twitter.com/intent/tweet?url=http://www.baidu.com&text=hello world">twitter2</a>



<a target="_blank" title="Share on Twitter" class="social-share-links__link social-share-links__link--twitter" href="https://twitter.com/intent/tweet?text=Make%20a%20Neon%20Vector%20Shooter%20in%20jMonkeyEngine%3A%20The%20Basics&url=http%3A%2F%2Fgamedevelopment.tutsplus.com%2Ftutorials%2Fmake-a-neon-vector-shooter-in-jmonkeyengine-the-basics--gamedev-11616&via=tutsplus"
sl-processed="1"><i class="fa fa-twitter social-share-links__icon"></i><div class="social-share-links__count">4</div></a>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: