Friday, 02 August 2013 23:19

how to post to facebook wall by facebook dialog

Written by 
Rate this item
(0 votes)
Facebook dialog is a great way to post to a profile/page wall.
There are many dialogs in faceook developer doc page -
https://developers.facebook.com/docs/dialogs/
I will show here feed dialog for the purpose -

Following function shows the function which post to wall
using feed dialog.Read details below -

function Msfbwall_PostToWall()
{
FB.ui(
{
method: 'feed',
name: ''+ jQuery("#msfbwall_postwallname").val()+'',
link: ''+jQuery("#msfbwall_postwalllink").val()+'',
picture: ''+jQuery("#msfbwall_postwallpic").val()+'',
caption: ''+jQuery("#msfbwall_postwallcap").val()+'',
description: ''+jQuery("#msfbwall_postwalldesc").val()+'',
display: 'popup',
to: jQuery("#msfbwall_store_sourceid").val(),
//from:
},
function(response) {
if (response && response.post_id) {
location.reload(true);

} else {
alert('Erors while posting');
}
}
);
}

<div id="post_div" onclick="Msfbwall_PostToWall()">Post using dialog</div>

As it is shown that i am populating some fields like name,link..
from values entered by user in input box.Also notice i set "to"
field as a id of the profile/page.When "Post using dialog" div clicked
the dialog will be shown as popup with those fields, there user can
enter message and post to facebook.I did not show here other html
input box codes.


hope that easily understood and helps a lot.Don't forget to like,
share and give a +1 in google search.
Read 4052 times
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.

Latest discussions

  • No posts to display.