【问题标题】:Social Sharing / Render 'like' button after ajax call on tumblr在 tumblr 上进行 ajax 调用后,社交分享/呈现“喜欢”按钮
【发布时间】:2015-10-31 10:43:46
【问题描述】:

对于 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>

谢谢 M

【问题讨论】:

  • Tumblr 支持人员告诉我,他们没有时间研究这样的问题 :(
  • $( "div" ).html( 'button code here' );?
  • 感谢您的帖子。我现在已经从 sharethis.com 获取了按钮。使用命令 "stButtons.locateElements()" -> stackoverflow.com/questions/7289021/… ajax 调用后会显示按钮。

标签: php jquery ajax tumblr


【解决方案1】:

我必须找到另一个解决方案(因为我有另一个用例)并解决了这个问题:

<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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-20
    • 2016-04-04
    • 1970-01-01
    • 1970-01-01
    • 2014-02-26
    • 2012-01-29
    相关资源
    最近更新 更多