PHP and jQuery to create : facebook post to wall system

Assuming that you have not perused our past post on making a Facebook post to divider framework then you might as well read it first. In this article, we will demonstrate how I included code antiquated bind” for the purpose that when clicked, it will post the substance of the content range as divider post.

HOW IT WORKS ?

When you click on “share” button :

The file insert.php is called via ajax to save message in database, if message is saved successfully , then add message to the unordered list like below:

<ul id=”posts”>
<li>My wall post message </li>
</ul>

Jquery code below is used to add the message as list :
$(‘ul#posts’).prepend(‘My wall post message’);

The textarea message is then cleared
$(‘textarea#wall’).val(”);

If another message is shared on the wall , it is added on the dom like this :
<ul id=”posts”>
<li>This is my second post </li>
<li>My wall post message </li>
</ul>

Download Files

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s