![](/img/trans.png)
[英]How to post to the wall like the admin of a page using the Facebook JavaScript SDK?
[英]How to post HTML message in Facebook wall using Javascript SDK?
如何使用Javascript SDK在FB牆中發布包含HTML代碼的消息文本?
目前正常發布在牆上顯示HTML代碼。 這是我的代碼-
$message = 'has shared this offer through <a href="http://www.google.com/">Test App</a>.<p/>-Thanks';
FB.api('/me/feed', 'post', {
message : $message,
picture : imgSrc
}, function(response) {
if (!response || response.error) {
console.log('Error occured');
alert('Error : ' + response.error);
} else {
alert('Post ID: ' + response.id);
console.log('Post ID: ' + response.id);
}
});
Facebook不允許您發布HTML。
您可以使用\\n
回車符進行換行符,所有URL都會自動超鏈接:
$message = "has shared this offer through Test App (http://www.google.com/)\n\n-Thanks";
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.