Facebook like button error Message - facebook

I added a facebook like button in my page. The page is rendered by using AJAX.
Here is my code:
$(document).ready(function(){
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
});
When I access this page via Chrome, Chrome keeps log the error message:
Blocked a frame with origin "https://www.facebook.com" from accessing a frame with origin "site url" The frame requesting access set "document.domain" to "facebook.com", but the frame being accessed did not. Both must set "document.domain" to the same.
Thanks a lot for your help.

I just found this on the facebook developer site:
"This is a warning in Chrome that has no ill side effects
Please check whether you have any extensions installed."
http://developers.facebook.com/bugs/586120791417551/
It may be that you have a content script from an extension that is generating these errors. My site is slo showing several of these errors in the console log. However, the facebook button is operating correctly. I am going to test in a chrome session with no extensions installed.
Is your facebook like button functioning correctly (other than throwing messy console errors)?

Related

Facebook's new "Page Plugin" doesn't show anything

I'm having tremendous trouble getting the new Facebook Page Plugin to work. I discovered that I needed to change SDK src path from //... to http://... because, for some reason it wouldn't load while testing locally.
So in the script that loads the SDK, it now says
...
js.src = "http://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4&appId=471086929645819";
...
instead of
...
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4&appId=471086929645819";
...
But now, instead of just getting a plain link to the page (which happened because the SDK didn't load), I get nothing. If I open up the Firefox Network Monitor in the console, I can actually see a bunch of GET requests for all my friends' profile images for use in the widget. So I know that it's actually loading the data, but it's not displaying it on the page. Any idea what's going on? Here's the exact code of the HTML file I'm testing on.
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "http://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4&appId=471086929645819";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-page" data-href="https://www.facebook.com/TheWelcomingCommittee" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-show-posts="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/TheWelcomingCommittee">The Welcoming Committee</blockquote></div></div>
</body>
I don't think you can successfully test it locally. I was having the same problem, so I created a test page with just the FB code on it (same as what you've posted here). When viewed locally (on Chrome, IE, and Firefox), the plugin was exhibiting the same behavior that you've described. The only solution was to upload the page to a web server for viewing - then I was able to see the plugin normally.

Facebook Sharer Returning 500 Internal Server Error on Desktop

I am attempting to use the share button on http://www.desiringgod.org/ on a Mac. It works for me on mobile, and on a desktop, the sharer dialog comes up properly. However, when clicking the Share Link button, dialog shows a short Facebook status bar and then does not respond. After inspecting in the browser's dev tool console, I see an 500 error.
Here's what I see in Firebug.
"POST https://www.facebook.com/ajax/sharer/submit_page/ 500 Internal Server Error"
"NetworkError: 500 Internal Server Error - //www.facebook.com/ajax/sharer/submit_page/"
Is anyone else experiencing this issue? Any ideas on how to resolve?
It seems like a FB issue, but I can't find much else about this online or on FB forums.
Thanks!
I had the same error and realized I was using a wrong app id. I'm not an admin of that faulty app id, so I don't know whether it was some settings in it (perhaps sandboxed) or something else. But changing it will definitely solve the issue for you
This seems to be a bug on Facebook's behalf - as their Like button plugin doesn't require an appId and their Share Button code-generator doesn't include any references to it being required.
That said I've found a workaround that doesn't require signup/AppID-registration.
What I did was simply to copy any existing AppID and stuff it at the end of the sdk.js URL, Like so:
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0&appId=XXX";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
(The one I used in place of the "XXX" above, was an App ID from one of Facebook's own sites.)
There seems to be no validation being performed, which again leads me to believe this is a temporary blunder made by Facebook.

xxx shared a link via Widget Share Log App

I've created a Facebook App and am using the FB developer tools to share content on a site.
However, when a link is shared it is titled "xxx shared a link via Widget Share Log App". I've seen other sites change this to read something like "xxx shared a link via Irrawaddynews" and I wondered if it was possible to do the same here.
BTW, I'm initiating the Facebook SDK with the code below (as per the instructions here: "shared a link via Widget Share Log App." - but this didn't solve my problem).
window.fbAsyncInit = function() {
FB.init({
appId : '{MY_APP_ID}',
status : true,
xfbml : true
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
In your App ID settings on Facebook, there are a few fields you have to update. We wrote pretty detailed setup instructions for doing this in conjunction with our own share software, but there's a general section beneath that for setting up the Facebook app:
https://naytev.zendesk.com/hc/en-us/articles/202777178-Link-Naytev-to-Your-Facebook-App
#userfuser - you actually don't need their validation, you simply need to make the app active. The process has a pretty terrible UX, and missing fields like "support email" will cause you to not be able to activate without a helpful error message.

how to fix fabook js like code so it accesses facebook with either http or https

On my website http://stokesabode.com I have installed the Facebook Js like code using async. Although it appears to be working correctly Google page speed testing reports I should
Serve resources from a consistent URL
along with the resulting error that I am accessing facebook using both non secure and secure http.
I am using the Facebook code generator that provided:
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.async=true;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=my application id number";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
In testing I found that if I remove either:
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=my application id number";
or
(document, 'script', 'facebook-jssdk')
and rerunning the test the error would disappear and my page speed score will jump up. How can I fix this error so I am only accessing facebook in secure https mode?

Facebook registration plugin security/https error

I'm using the Facebook Registration Plugin on my site, but I'm getting security errors in Firefox (10) and Safari (5).
I have this code in HTML:
<fb:registration fields="[{'name':'name'}, {'name':'email'}, {'name':'company', 'description':'company', 'type':'text'}]" redirect-uri="http://[url removed]/" width="318" height="360"></fb:registration>
So the redirect-uri is in http. I insert the JS SDK with the code provided by Facebook:
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "http://connect.facebook.net/" + language + "/all.js#xfbml=1&appId=107844832676140";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
Everything works fine in Chrome and IE9, but I get a security warning in Firefox and Safari. In Firefox I get this error message:
"Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection and could easily be read by a third party.
Are you sure you want to continue sending this information?"
In both Firefox and Safari I can press ok and go ahead with posting the form. But how do I get rid of this security message? Does the page I am posting to need to be in https?
Looks like a problem with http and https.
My guess is that your page is over https, but in your code you load the facebook sdk over http, which is not a good idea...
change this:
js.src = "http://connect.facebook.net/" + language + "/all.js#xfbml=1&appId=107844832676140";
to this:
js.src = document.location.protocol + "//connect.facebook.net/" + language + "/all.js#xfbml=1&appId=107844832676140";
Developers complain of getting security warnings in browsers like Firefox and safari. For instance, Firefox gives security warning like -
Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection and could easily be read by a third party. Are you sure you want to continue sending this information?
User can press ok and go ahead with posting the form. However, web developer do not want users' to avoid registration because of this securty warning.
For solution Please refer to:
http://blog.oursocion.com/2012/07/facebook-registration-plugin.html