tailieunhanh - developing facebookbapplications phần 3

FBML là một trong những tính năng mạnh mẽ nhất của nền tảng Facebook. Nó hoạt động như một mở rộng của HTML cung cấp cho bạn một số thành phần người sử dụng giao diện dựng sẵn. FBML được dịch sang HTML bình thường khi Facebook xử lý trang của bạn. | Sending an Invitation 40 Creating the Invitation Form Using FBML We ll start building our user interface by creating a simple view Download chapter2 karate_poke app views invitations fb fbml fb request-form action new_invitation_path method POST invite true type Karate Poke content I added a cool application. fb multi-friend-selector showborder false actiontext Invite your friends to use Karate Poke. fb request-form fb fbml That looks a little like HTML but I bet you ve never seen those tags before. What you re seeing is the Facebook Markup Language FBML . FBML is one of the most powerful features of the Facebook platform. It acts as an extension to HTML that gives you some prebuilt user interface components. FBML is translated into normal HTML when Facebook processes your page. We ll see a little bit of FBML here and will cover it in great detail in Chapter 5 Getting Into the Facebook Canvas on page 85. Before we get into the details of how the view works let s see what it does. Start up script server and then open a browser to your invitation Make sure you re logged in as one of your test users. After clicking Allow on the authorization page you should see something that looks like Figure on the next page. If you don t make sure you ve copied the code exactly. You should also make sure the test user you re using has at least one friend. That s pretty impressive for just a few simple lines of code Since there are only three different FBML tags in our view let s look at each one. The first tag fb fbml is similar to the html tag. It marks the start of an FBML document. Your canvas pages will still work without the fb fbml tag but it is required for profile pages. It s best to get into the habit of always wrapping your pages in an fb fbml tag. The next tag fb request-form starts a special type of Facebook form. This special form allows your application to create Facebook requests. 8. http canvas_path invitations new Sending an .

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG