社交分享/渲染'喜欢' ajax调用tumblr后的按钮

时间:2015-10-31 10:43:46

标签: php jquery ajax tumblr

对于Facebook和Google,我找到了这个解决方案..

<script type="text/javascript">
 $(document).ajaxComplete(function(){
 try{
    FB.XFBML.parse(); 
    gapi.plusone.go(); 
 }catch(ex){}
 });
</script>

但不适合tumblr。有人知道是否有任何解决方案? Tubmlr-post-button的实现方式如下:

<a class="tumblr-share-button" data-href="http://www.xy.ch/news_entries/<?    php echo "{$row['title']}.html" ?>" data-content="http://www.xy.ch/news_entries/<?php echo "{$row['title']}.html" ?>" data-color="blue" data-notes="right" href="https://embed.tumblr.com/share"></a>

由于 中号

1 个答案:

答案 0 :(得分:0)

我必须找到另一个解决方案(因为我有另一个用例)并且计算出来了:

<img src='http://www.mywebsite.com/share_list.png' data-pin-no-hover="true" class="share_buttons_img" usemap='#share_buttons' />
<map name='share_buttons'>
  <area shape='circle' coords='78,21,13,80' href="#" title="Share on Facebook" onclick="popUp=window.open('https://www.facebook.com/sharer/sharer.php?u=www.mywebsite.com/news/<?php echo "{$row['image_title']}.html" ?>','popupwindow', 'scrollbars=yes,width=500,height=400');popUp.focus();return false;" >             
  <area shape='circle' coords='116,21,13,80' href="#" title="Share on Tumblr" onclick="popUp=window.open('http://tumblr.com/widgets/share/tool?canonicalUrl=http://www.mywebsite.com/news/<?php echo "{$row['image_title']}.html" ?>','popupwindow', 'scrollbars=yes,width=500,height=400');popUp.focus();return false;" >
  <area shape='circle' coords='153,21,13,80' href="#" title="Share on Google+" onclick="popUp=window.open('https://plus.google.com/share?url=www.mywebsite.com/news/<?php echo "{$row['image_title']}.html" ?>','popupwindow', 'scrollbars=yes,width=500,height=400');popUp.focus();return false;" >
</map>