【问题标题】:Pinterest and Google+ Share buttons won't open from inside an iframePinterest 和 Google+ 分享按钮不会从 iframe 内部打开
【发布时间】:2013-09-26 21:49:19
【问题描述】:

我有一个 tumblr 网站,其中每个帖子都有 Facebook、Twitter、Pinterest、Google+ 和电子邮件的分享按钮。它们都应该在新窗口中打开。 Facebook 和 Twitter 可以,但 Pinterest、G+ 和电子邮件在同一个窗口中打开。

此 tumblr 网站将存在于公司主网站的 iframe 中。在主站点上,Pinterest、G+ 和电子邮件链接根本打不开。他们什么都不做。 Facebook 和 Twitter 链接的行为与之前的行为相同;他们工作。

这是我用于链接的 html:

    <ul>
         <li class="open-in-app"><a href="#" class="share-item open-in-app" data-post="{PostID}">Open in app</a></li>
         <li><a href="http://facebook.com/sharer.php?u={URLEncodedPermalink}&amp;t={URLEncodedTitle}" class="share-item facebook" target="_blank"><img src="http://cdn.shopify.com/s/files/1/0248/9574/t/1/assets/productShareFB.png?7867"></a></li>
         <li><a href="https://twitter.com/intent/tweet?text={URLEncodedTweetSummary}" class="share-item twitter" target="_blank"><img src="http://cdn.shopify.com/s/files/1/0248/9574/t/1/assets/productShareTwitter.png?7867"></a></li>

         <li><a href="http://pinterest.com/pin/create/button/?url={URLEncodedPermalink}&amp;media={PhotoURL-HighRes}&amp;description=Isaora" class="share-item"><img src="http://cdn.shopify.com/s/files/1/0248/9574/t/1/assets/productSharePinterest.png?7867"></a></li>
         <li><a href="mailto:?subject={URLEncodedShareString}&amp;body={URLEncodedMailSummary}" class="share-item mail"><img src="http://cdn.shopify.com/s/files/1/0248/9574/t/1/assets/productShareMail.png?7867"></a></li>
         <li><a href="https://plus.google.com/share?url={URLEncodedPermalink}" class="share-item"><img src="http://cdn.shopify.com/s/files/1/0248/9574/t/1/assets/productShareGPlus.png?7867"></a></li>
     </ul>

我该怎么做:
* 获取电子邮件、pinterest 和 g+ 链接以在 tumblr 网站上工作在 iframe 内
* 让他们在新窗口中打开。

【问题讨论】:

  • 您的 twitter 和 facebook 链接具有 target=_blank 属性,但其他链接没有,您知道吗?
  • 啊。我已经盯着这个太久了。谢谢!很抱歉浪费您的时间。

标签: html iframe google-plus tumblr pinterest


【解决方案1】:

在 iframe 中获取电子邮件、pinterest 和 g+ 链接以在 tumblr 网站上工作

你不能。它们使用 HTTP 标头告诉浏览器它们不应该在框架中打开。

让他们在新窗口中打开。

和已经在新窗口打开的链接一样:

target="_blank"

【讨论】:

    猜你喜欢
    • 2014-04-14
    • 2013-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多