I'm using the same code provided in the here
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
console.log('got here');
FB.init({
appId : '197112467099018', // App ID
channelUrl : '//WWW.MYDOMAIN.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
});
// Additional initialization code here
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
Chrome's console is telling me the script failed to load (GET failed) with 2 errors which are labeled (anonymous function)
The lines it points to as the errors are:
ref.parentNode.insertBefore(js, ref);
}(document));
Can anyone help me figure out whats wrong with these lines?
I was using ghostery in chrome and didn't notice it blocked 'facebook connect'. I bet you have a similiar problem. Just happened to me.
Make sure you're running this code in the context of a web server (your browser URL starts with http: or https: protocol), and not from a local file (should not start with file:).
Make sure you put that snippet in the <body>
and not <head>
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With