I'm unable to moderate the comments in the comments box in http://developers.facebook.com/tools/comments
Did I miss something in my code?
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '168365613230111',
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>
<div class="fb-comments" data-href="http://www.facebook.com/" data-num-posts="5" data-width="500"></div>
I struggled with this for ages, try putting this tag in ...
<html xmlns:fb="http://yourwebsite.com">
Related
I googled for nearly 4 hours and am posting this.
I am trying to implement facebook login in my website.
The problem is login is working fine, after login it has to redirect to anther custom page,
its not redirecting but staying in the same page. Here is my code that am using.
<head>
<title>My Facebook Login Page</title>
<script src="//connect.facebook.net/en_US/all.js"></script>
</head>
<body>
<div id="fb-root"></div>
<fb:login-button perms="email"></fb:login-button>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'XXXXXXXXXX',
status : true,
cookie : true,
xfbml : true
});
FB.Event.subscribe('auth.login', function() {
window.location = "about_us.html";
});
};
(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>
<!-- <div class="fb-login-button" >Login with Facebook</div> -->
Kindly guide me where am wrong also if possible correct code
I had taken the code from below link.
Redirect after clicking on the Facebook login button, even if already logged in Facebook
Thanks in advance.
you can just add this somewhere
FB.login(function(response) {
if (response.authResponse) {
window.top.location = "http://www.foo.com";
}
});
When I put
window.top.location = "http://www.foo.com";
under
FB.getLoginStatus(function(response) {
statusChangeCallback(response);
window.top.location = "";
});
it worked.
I am building a facebook connect website, and the facebook connect is returning everything i need except for the email, even though i have the data-scope saying i want the email.
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: 'xxxxxxxxxx', status: true, cookie: true, xfbml: true});
};
(function() {
var e = document.createElement('script');
e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
<div id="social-register" class="registration_panel">
<a id="facebook-login" class="fb_button fb_button_medium" data-scope="email,user_checkins" href="home/login">
<span class="fb_button_text">Login with Facebook</span>
</a>
</div>
Can anyone tell me what i could be doing wrong ? thx
Based upon the code you have in your question, I believe you are missing code to call to get user information. After calling FB.getLoginStatus(callBack) and verifying they're logged in, then you can call FB.api('/me?fields=email',callBack);
I am really struggling with how to get the scroll bars off of my tab. I am simply trying to create a Facebook tab for a company Facebook page and I have tried everything to get the vertical scroll to go away. Here is the code I am working with
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link href="facebookstyles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="scripts/jquery.innerfade.js"></script>
<fb:share-button type="icon_link" class="url"></fb:share-button>
</head>
<body>
<table>
CONTENT
</table>
<p> </p>
<p> </p><div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: '{{277868305571181}}', status: true, cookie: true,xfbml: true});
window.setTimeout(function() {
FB.Canvas.setSize({height:1500});
}, 250);
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
</body>
</html>
You may need to enable OAuth2 in your application settings.
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: '277868305571181',
status: true,
cookie: true,
xfbml: true,
oauth : true // enable OAuth 2.0
});
FB.Canvas.setAutoGrow();
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
I have multiple apps which use the fb:friend-selector
The form element is no longer appearing. Nothing has changed in the code.
Example:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'myyappid',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
channelUrl : 'http://mydomain.com/channel.html', // Custom Channel URL
oauth : true //enables OAuth 2.0
});
};
(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:serverfbml>
<script type="text/fbml">
<fb:fbml>
<fb:friend-selector />
</fb:fbml>
</script>
</fb:serverfbml>
Just found a solution, ditch the standard html <form> and use the <fb:editor> instead. Yes, this is perhaps not exactly what you want, but now the <fb:friend-selector> will render.
try to explixitly parse the XFBML using FB.XFBML.parse:
http://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse/
I'd also recommend to put it inside some div element
FB.XFBML.parse(document.getElementById('MY_DIV'));
I am new in facebook application. I have a problem with this application when it run on IE.
After login it redirect to search action (zend-framework), And then when i click button to redirect another action as well as same action. it destroy session.
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : '<?php echo $this->appid ?>',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.Canvas.setSize({width: 760, height: 980});
};
(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>
HTML CODE
<div class="cross">
<a href="<?php echo $this->url(array('controller' => 'index', 'action' =>'search','cancel'=>'c'),'default',true) ?>">
</a>
</div>
please help me.
Thanks for considering.
In your controller, try adding this to your init() function.
$this->getResponse()->setHeader('P3P', 'CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
It's a known problem with IE
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : '<?php echo $this->appid ?>',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.Canvas.setSize({width: 760, height: 980});
};
(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>