Skip Navigation LinksHome > Categories > Code from a Category

Developing Facebook Application with .NET Adding User-page Interactions with FBML and FBJS

User Name: tippu
Name: King SheZ
Contact Me:
Home Page:
7 years of enterprise application development, so far in my career i have worked on enterprise web applications with millions of users,i have also worked on many integrations between applications, i h... [More]
Viewed Times: 1983
Add Date: 07/19/2011
In last article i explained the basics of how to get started for Facebook application development. In this article i will explain how the user page interacts with Facebook using FBML (Facebook Markup Language) and FBJS(Facebook Javascript Service).

I will continue from my last post where i finished.

As you may know, you can use FBJS on FBML pages. So, let's modify the grid to add a link on each row:

Notice the calls to select_object() JavaScript (FBJS) for each row. So, when the user clicks on the "select..." link of the grid row, the page will display the selected row and will allow the user to perform some actions on selected items:

Selected information is displayed in its own DIV element:

So, my JavaScript (FBJS) function is:


Notice that I'm using Animation() to show the DIV element; see FBJS/Animation for more information. As you can see, in order to change SPAN innerText, I'm using the setTextValue() method. For a button, I'm using setValue(). To provide the user with the ability to select a Friend, we can add the FBML element (more at Fb:friend-selector).

* Notice the idname attribute of the element. It is the name of the hidden form element that contains the user ID of the selected friend when the form is being submitted, as we will see later on.

The result is:

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.