How to post a message text having HTML codes in it, in FB wall using Javascript SDK?
Currently normal posting is showing HTML codes in wall.
Here is my Code –
$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 doesn’t allow you to post HTML.
You can do line breaks with
\ncarriage returns, and any URLs will be automatically hyperlinked: