请帮帮我这是我要嵌入Facebook共享脚本的代码。
<a href=""><i class="fa fa-facebook fa-2x"></i></a>
这就是我嵌入它的方式
<script>function fbs_click() {u=location.href;t=document.title;window.open(‘http://www.facebook.com/sharer.php?u=’+encodeURIComponent(u)+’&t=’+encodeURIComponent(t),’sharer’,’toolbar=0,status=0,width=626,height=436′);return false;}</script>
<a href="<?php echo'http://www.facebook.com/share.php?u=';?><?php the_permalink(); ?>"
onclick=”return fbs_click()” target=”_blank”><i class="fa fa-facebook fa-2x"></i></a>
答案 0 :(得分:0)
<script>
function facebook()
{
window.open("http://facebook.com/sharer.php?app_id=1433580610197489&sdk=joey&u=<?php the_permalink(); ?>","_blank","toolbar=no, scrollbars=no, resizable=yes, top=500, left=500, width=650, height=540");
}
function google()
{
window.open("https://plus.google.com/share?url=<?php the_permalink(); ?>","_blank","toolbar=no, scrollbars=no, resizable=yes, top=500, left=500, width=650, height=540");
}
function twitter()
{
window.open("http://twitter.com/home?status=<?php the_permalink(); ?>","_blank","toolbar=no, scrollbars=no, resizable=yes, top=500, left=500, width=650, height=540");
}
function linkedin()
{
window.open("http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&title='.$title.'","_blank","toolbar=no, scrollbars=no, resizable=yes, top=500, left=500, width=650, height=540");
}
function pinterest()
{
window.open("http://pinterest.com/pin/create/link/?url=<?php the_permalink(); ?>","_blank","toolbar=no, scrollbars=no, resizable=yes, top=500, left=500, width=650, height=540");
}
</script>
<ul>
<li class="social-facebook"><a title="Facebook" onclick="facebook()" ><i class="fa fa-facebook"></i></a></li>
<li class="social-gplus"><a title="Google+" onclick="google()" ><i class="fa fa-google-plus"></i></a></li>
<li class="social-twitter"><a title="Twitter" onclick="twitter()" ><i class="fa fa-twitter"></i></a></li>
<li class="social-pinterest"><a title="Pinterest" onclick="pinterest()" ><i class="fa fa-pinterest"></i></a></li>
<li class="social-linkedin"><a title="LinkedIn" onclick="linkedin()" ><i class="fa fa-linkedin"></i></a></li>
</ul>