[英]facebook like button not working correctly
我的facebook喜歡按鈕有問題。 基本上,我的頁面上有一個ajax庫,因此當圖像更改時,我會更改我的facebook按鈕,以便該按鈕代表新圖像的URL。 但是,當我單擊“共享”時,即使它已更改,它也只共享原始URL。 這是一個例子:
頁面加載時,facebook按鈕的代碼為:
<iframe scrolling="no" frameborder="0" style="border: medium none; overflow: hidden; width: 80px; height: 21px;" allowtransparency="true" src="http://www.facebook.com/plugins/like.php?href=http://go-style.co.uk/test-gallery/&layout=button_count&show_faces=false&width=80&action=like&font=lucida+grande&colorscheme=light"></iframe>
然后,我使用jQuery將代碼更改為此:
<iframe scrolling="no" frameborder="0" style="border: medium none; overflow: hidden; width: 80px; height: 21px;" allowtransparency="true" src="http://www.facebook.com/plugins/like.php?href=http%3A//go-style.co.uk/nggallery/page-7029/image/30&layout=button_count&show_faces=false&width=80&action=like&font=lucida+grande&colorscheme=light"></iframe>
但是點擊新按鈕會喜歡原始網址
有人知道為什么會這樣嗎?
更改iRC后,您是否嘗試過刷新iframe?
$('#youriframe').attr("src", $('#youriframe').attr("src"));
最終,這是facebook的緩存問題!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.