2013-10-22 55 views
0

我似乎無法將鏈接嵌入FB.ui的描述部分。我嘗試了顯而易見的插入標籤,但沒有奏效。如何使用FB.ui在Facebook Feed對話框的描述中使用鏈接?

FB.ui({ 
    method: 'feed', 
    name: 'Los Angeles, CA, United States', 
    caption: 'The current condition for Los Angeles is Fair.', 
    description: 'Temperature is 58&deg;F.\nLook at details: <a href="www.google.com">here</a>', 
    link: 'www.google.com', 
}, function(response){}); 

請幫忙!

下面的結果是什麼,我試圖生產:

enter image description here

+0

你不能把自己的鏈接進入的描述,它就會如被Facebook純文本處理。無論如何,爲什麼要這樣做,因爲已經有一個鏈接了?重複相同的鏈接?多餘的。在描述中使用另一個鏈接?令用戶感到困惑。 – CBroe

回答

1

我想通了。答案是一個JSON對象傳遞到properties參數:

var p = { 
    "Look at details": { 
     "text": "here", 
     "href": "http://www.google.com" 
    } 
}; 

FB.ui({ 
    method: 'feed', 
    name: 'Los Angeles, CA, United States', 
    caption: 'The current condition for Los Angeles is Fair.', 
    description: 'Temperature is 58&deg;F.\nLook at details: <a href="www.google.com">here</a>', 
    link: 'www.google.com', 
    properties: p 
}, function(response){}); 
+0

我試過這個,但它不適合我...任何想法.. – Catmandu

+0

屬性屬性已被棄用https://developers.facebook.com/docs/sharing/reference/feed-dialog – DeepBlue

相關問題