【问题标题】:Hashtag in pinterest share descriptionpinterest 分享描述中的标签
【发布时间】:2015-01-14 07:47:17
【问题描述】:

我正在尝试在我的页面上设置与 pinterest 的社交分享。它工作正常,除了主题标签似乎没有出现。

我很快拼凑了一个jsfiddle with my code。如您所见,我在描述中添加了一个标签,但是当弹出共享框时,它会完全省略标签。

<a onclick="return !window.open(this.href, 'Share on Pinterest', 'width=640, height=536')" 
href="http://pinterest.com/pin/create/button/?
url=http://google.com&media=http://dummyimage.com/600x400/000/fff&description=this is a #hashtag" 
class="pin-it-button" count-layout="horizontal"> 
<img src="https://cdn.shopify.com/s/files/1/0636/3475/files/pinterest_e8e717fe-0b0d-4a38-8290-5c5beb871dd4.png?9971" width=22/></a>

有谁知道我如何在描述中添加主题标签并让它发挥作用?我尝试使用

感谢您的帮助!

【问题讨论】:

    标签: html pinterest


    【解决方案1】:

    您需要对 URL 的 # 进行编码 - 将其替换为 %23 ,您将获得所需的结果 - Fiddle

    <a onclick="return !window.open(this.href, 'Share on Pinterest', 'width=640, height=536')" href="http://pinterest.com/pin/create/button/?url=http://google.com&media=http://dummyimage.com/600x400/000/fff&description=this is a %23hashtag" class="pin-it-button" count-layout="horizontal">
       <img src="https://cdn.shopify.com/s/files/1/0636/3475/files/pinterest_e8e717fe-0b0d-4a38-8290-5c5beb871dd4.png?9971" width=22/>
    </a>
    

    【讨论】:

    • 这就是我要找的。谢谢!
    【解决方案2】:

    尝试将“#”替换为标签的 HTML 字符:

    &#35;
    

    【讨论】:

    • 经过测试,这似乎也不起作用。对于那个很抱歉。我会继续挖掘。
    • 我相信您将不得不使用 JavaScript 动态添加主题标签。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-14
    • 1970-01-01
    相关资源
    最近更新 更多