I’m trying to integrate a Facebook send button into my site using Facebook app. I have created an app in Facebook, and provided my site url in the website link:
I’m using the the following code in my webpage:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: '1xxxxxxxxxx', status: true, cookie: true, xfbml: true});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol + '//connect.facebook.net/en_GB/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
<script>
function trace(message) {
var div = document.getElementById('trace');
div.innerHTML = div.innerHTML + message + '<br/>';
}
</script>
It’s not displaying a window to login for sending mail to friends.
You’re missing the markup for the send plugin. It will look something like this:
<div class="fb-send" data-href="http://example.com"></div>Also the
js.src =line should be like:js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId={APPID}";