I like to set Connect button inside Facebook platform.
// Load the SDK Asynchronously
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR_APP_ID', // App ID
channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
and
(function(){
var fb = document.createElement('script'); fb.async = true;
fb.src = "//connect.facebook.net/en_US/all.js";
document.getElementsByTagName('head')[0].appendChild(fb);
}());
1. Is this correct change?
2. Where is correct language folder list as I have many countries like:
en_US
3. Will xfbml: true change in the correct way top part like:
<html xmlns:fb="http://ogp.me/ns/fb#">
4. Is there need for id = 'facebook-jssdk'; if (document.getElementById(id)) {return;}js.id = id;
what will do this ID?
5. How is defined fb-root inside getElementById('fb-root')
as there is quoted:
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
document.getElementsByTagName('head')[0].appendChild(js);
}(document));