May 2011
Beginner
408 pages
10h 27m
English
Now it's time to put everything I discuss into action. Pretend that you have a Web site that is a CD store and you want to give your customers an easy way to find the CDs their friends are liking and sharing on Facebook. I add a simple Recommended CDs section to the bottom of that page. Here's the minute-by-minute account of what you need to do to set that up.
I start by adding the init script and Login button that you created earlier. Start by creating an application for your Web site, or adding your Web site URL and domain to an existing application. Then follow these steps:
<div id="fb-root_18_chapter-07"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR APP ID',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the
session
xfbml : true // parse XFBML
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
<fb:login-button autologoutlink="true"></fb:login-button>
FB.Event.subscribe('auth.sessionChange', function(response) { if (response.session) ...Read now
Unlock full access