java 部落格分享實現--facebook--linkein

瓜瓜東西發表於2015-04-08
<!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&amp;url=http%3A%2F%2Fgamedevelopment.tutsplus.com%2Ftutorials%2Fmake-a-neon-vector-shooter-in-jmonkeyengine-the-basics--gamedev-11616&amp;via=tutsplus" sl-processed="1"><i class="fa fa-twitter social-share-links__icon"></i><div class="social-share-links__count">4</div></a>

相關文章