您的位置:首页 > Web前端 > JavaScript

facebook 分享 js

2017-04-18 13:17 176 查看
<html>
<head>
<meta property="og:image" content="http://www.huitu.com/design/show/20130116/142820494200.html?_t_t_t=0.7526275933756319" />
<meta property="og:description" content="test>" />
<meta property="og:url" content="https://www.baidu.com" />

</head>
<body>
<h2>Hello World!</h2>

<a style="display:inline-block;width:35px; height:40px; position:relative; top:10px; left:48px; "
title="Share on Facebook" target="_blank"
onclick="javascript:window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent('https://www.baidu.com')+'&t='+encodeURIComponent(document.title), 'newWindow', 'width=800, height=400','center');void(0);">分享到facebook</a>

<br>
<br>
<a href="javascript:window.open('http://twitter.com/home?status='+encodeURIComponent('https://image.baidu.com')+' '+encodeURIComponent('aaaaaa'),'_blank','toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=600, height=450,top=100,left=350');void(0)" >twitter分享</a>

<br>
<br>
<a href="//www.pinterest.com/pin/create/button/" data-pin-do="buttonBookmark"  data-pin-shape="round" data-pin-height="28">pinterest分享</a>
<script type="text/javascript" async src="//assets.pinterest.com/js/pinit.js">
</
b045
script>

<div style="float:right;">
<!-- Place this tag where you want the +1 button to render -->
<g:plusone></g:plusone>
<!-- Place this tag after the last plusone tag -->
<script type="text/javascript">
window.___gcfg = {lang: 'zh-CN'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</div>
</body>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息