簡體   English   中英

iframe頁面內的Facebook Like按鈕

[英]Facebook Like button inside a page in an iframe

我試圖在我創建的窗口(aspx)中使用fb“贊”按鈕,該窗口加載到iframe中(與fb iframe無關),當我按“贊”按鈕時,打開的對話框不會t具有我放入meta標記中的詳細信息,但是,如果我進入該頁面-不是從iframe中進入,則當我按“贊”按鈕時,一切加載良好,當我查看iframe源時,可以看到meta標簽,但由於某種原因,它無法在iframe中運行,有人知道答案嗎?

這是位於iframe中的頁面(代碼是部分代碼):

<head>
<meta property="og:title" content="My Article Title" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://localhost:8081/" />
<meta property="og:image" content="http://localhost:8081/photos/LogoHeaderNew.png" />
<meta property="og:description" content="My article description" />
<meta property="og:site_name" content="My Site Name" />
</head>

<body>
    <form id="form1" runat="server">
              <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
        <div id="Div_FaceBook" style="display:inline-block;float:left;margin-top:10px;margin-right:15px;margin-top:8px;width:auto;">                 
             <fb:like href="http://localhost:8081" show_faces="false" share="false" width="450" font="" data-layout="button_count">
             </fb:like>
         </div>
    </form>
</body>

之所以失敗,是因為Facebook的服務器看不到位於http://localhost:8081的頁面。

為了使您能夠喜歡一個URL,該URL必須在開放的網絡上可見,以便Facebook可以對該URL進行HTTP GET並讀取其中的元標記。

由於您所指向的開放圖URL位於本地主機,因此Facebook無法爬入該頁面。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM