Tumblr 的分享按钮脚本不起作用

Tumblr's share-button script doesn't work

在 rails 应用程序中,我有一个 Tumblr 分享按钮:

<a href="<%= "https://www.tumblr.com/widgets/share/tool?canonicalUrl=#{tips_and_trick_url(tip)}" %>" data-title="<%= tip.title %>" data-content="<%= tip.content %>" target="_blank">

正如文档中所说,我必须在 </body> 标记之后包含 <script id="tumblr-js" async src="https://assets.tumblr.com/share-button.js"></script>。单击共享按钮会将我带到一个新选项卡,但据我所知,应该会出现一个弹出窗口 window。那么,问题是如何达到预期的效果,让弹窗window出现?谢谢

On pages that include the JavaScript code of our "Share" button (listed below), this button is a binding tag with the tumblr-share-button: class tumblr-share-button:

您似乎缺少 class 属性:

<a class="tumblr-share-button" href="<%= "https://www.tumblr.com/widgets/share/tool?canonicalUrl=#{tips_and_trick_url(tip)}" %>" data-title="<%= tip.title %>" data-content="<%= tip.content %>"></a>

来源:https://translate.googleusercontent.com/translate_c?depth=1&hl=en&ie=UTF8&prev=_t&rurl=translate.google.co.uk&sl=auto&sp=nmt4&tl=en&u=https://www.tumblr.com/docs/ru/share_button&usg=ALkJrhg99ccfkG9zPv8gj6gxiMFxalMUGA