I am getting a javascript error for the FB Share button only in IE8. This started after the old Share button was disabled and subsequently re-enabled (see Facebook Share button: is it officially dead?)
The error I am getting is:
Message: Object doesn't support this property or method
FB.Share Line: 128
Code: 0 Char: 188
URI: http://static.ak.fbcdn.net/connect.php/js/FB.Share
Any ideas on how to fix this?
How about doing it this way?
http://www.facebook.com/sharer.php?s=100&p[title]=SHARE%20ME&p[summary]=SOME%20CONTENT&p[url]=http://www.google.com&p[images][0]=http://fakeurl.com/shareImage.gif
Breakdown:
http://www.facebook.com/sharer.php?s=100 - MAIN URL
&p[title]=SHARE%20ME - SHARE TITLE
&p[summary]=SOME%20CONTENT - SHARE PARAGRAPH
&p[url]=http://www.google.com - URL TO SHARE
&p[images][0]=http://fakeurl.com/shareImage.gif - SHARE IMAGE THUMBNAIL
I had a similar issue and removing the following line worked for me after hours of searching online.
<meta http-equiv="X-UA-Compatible" content="IE=7"/>
I used a slightly modified version of the answer in the link I gave originally:
<html xmlns:fb="http://ogp.me/ns/fb#" lang="en">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
</head>
<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 = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=YOUR_APP_ID"; // appId must be valid
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:share-button type="button" href="http://www.foobar.com"></fb:share-button>
</body>
What I found is that if you can set IE8 in protected mode by selecting Internet options -> Security ->Trusted Sites ->Enable Protected Mode, the page is working fine.
Related
Having a problem setting up the moderation toolkit on my facebook comments plug-in. I am trialling this on one page at the moment until I copy it to all pages to each have their own individual comments boxes.
Site Page: http://gp2aus.com/why-go.html
I have inserted the following after my head tag:
<!-- Facebook Comments Box App ID -->
<meta property="fb:admins" content="{100016298409099}"/>
<meta property="fb:app_id" content="{1321908721223176}" />
The following comes after the opening of the body tag:
<!-- Facebook Comments Box Script -->
<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_GB/sdk.js#xfbml=1&version=v2.9&appId=1321908721223176";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
And the following is in the correct location on my page within the body tag:
<!-- Facebook Comments Box -->
<div class="fb-comments" data-href="http://gp2aus.com/why-go.html" data-width="100%" data-numposts="100" data-order-by="reverse_time"></div>
I have tried all of the applicable solves I have found on SO.
My AppID is correct
AppID's match in the script and AppID pages
I am listed as a moderator in the Settings in the 'Tools & Support' section
I am not in the banned or blacklisted sections!
One thing that I wonder is the problem, but don't know how to fix, is that when I open the 'Facebook for Developers' site and click on the 'Tools & Support' it says that there are no comments for review. Which is odd given that I have just tried making some example comments from myself and another profile and nothing seems to come up.
Can't quite see what I'm doing wrong here but would much appreciate your collective wisdom!
S.
{} are used in the documentation to show that you need to insert a value at this point; they are not part of that value.
If you see f.e. {app-id} in there, it means you need to replace the whole placeholder {app-id} with the actual app id, not just put it inside the curly braces.
Fix that, and then use https://developers.facebook.com/tools/debug to refresh the cache and check for further errors.
I know this is supposed to be easy task and I have tried code from the developer sites of twitter and facebook as well but any of those code won't work.
I also tried from some other sites as well.
I have to put facebook/twitter share buttons in my webpage.Both the codes from the developer site are not working when I check then on XAMPP .
<html>
<head> Vamos </head>
<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 = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-share-button" data-href="https://developers.facebook.com/docs/plugins/"></div>
Tweet
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</body>
</html>
In above code in Chrome browser nothing except the head element gets displayed.
Could you please find what am I doind wrong and what should I do ?
I tried using XFBML (Add an XML namespace to the tag of your document.) but nothing worked for me.
Florentino, I tested the Facebook social plugin on my server and it's working as expected. Same issue as the one described in this thread.
Hi I'm tying to put a like button in my web but I have a problem with that, I'm using the code below
<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/es_LA/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-comments" data-href="https://www.facebook.com/petsandfashion?fref=ts" data-width="500px" data-numposts="5" data-colorscheme="light"></div>
But this doesn't work and appear an error "GET file://connect.facebook.net/es_LA/all.js". My question is I need put something more?, other script or call another function or something more?.
I put in the script this "js.src = "https://connect.facebook.net/es_LA/all.js#xfbml=1";"
but Is it fine?.
Sorry for my english.
error "GET file://connect.facebook.net/es_LA/all.js".
this caused by you accessed your index.html on browser using file:/// protocol instead of http:// or https://.
I put in the script this "js.src = "https://connect.facebook.net/es_LA/all.js#xfbml=1";" but Is it fine?.
You better remove it, for example if a user was visiting your page on http:// the js sdk will called on http://.
The same thing happens for a visitor accessing your site on https:// it will load it https://
I have the following code that logs the user in and displays the "Select Friends for Request" dialog ("apprequests"):
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>Test</title>
<script type="text/javascript">
function facebook(){
FB.login(function(response) {
if (response.authResponse) {
var access_token = FB.getAuthResponse()['accessToken'];
FB.ui({
method: 'apprequests',
message: 'Sample Title',
max_recipients:1
}, function(response){
console.log('OK');
});
}
}, {scope: 'publish_stream'});
}
</script>
</head>
<body>
<p>Test</p>
<div id="fb-root"></div>
<script type="text/javascript">
(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/es_LA/all.js#xfbml=0&appId=XXXXXXXXXXXXXX";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
</body>
</html>
The code is working with all major browsers (Firefox, Chrome, Opera, IE11, Safari for IOS, Android browser). Safari (for Mac/PC) is the exception: it's opening the "apprequests" dialog but the dialog comes up empty. If you change the dropdown options (to "Friends to Invite" and then to "All Friends" again) the friend list finally appears.
Any idea how to fix this bug?
Thank you!
It is reported bug of Facebook-API. As mark wiltse stated here:
We have managed to reproduce this issue and it appears to be a valid bug. We are assigning this to the appropriate team.
There is no need to handle separately for safari. You just need to on-hold this task until this bug get resolved by facebook developer.
I have included a Facebook Like box on a website i am creating and it only shows up when they are logged into facebook. When they have looged out the like box disappears not allowing anyone new to the site being able to see it. I have included all the code facebook tell you to put in but no joy.
Could anyone help me please.
The code i have used:
<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_GB/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
HTML code
<div id="fb_like">
<fb:like-box href="https://www.facebook.com/pages/Emma-Nolan-Mobile-Beauty- and-Holistic-Therapy/230397297018772" width="300" height="185" show_faces="true" stream="false" header="false" border_color="#FFFFFF"></fb:like-box>
</div>
The site is not using HTML5 so im using the XFBML. Is this something to do with the Facebook settings itself? This is a business page only.
Ive put the script in the head tag and at the bottom of the page to allow for loading, also placed it straight under the body tag as metioned by Facebook.
Add namespace to the html tag of your document.
<html xmlns:fb="http://ogp.me/ns/fb#">
Add this code directly below the < body > tag. Note: make sure to append the correct app id to the js sdk.
<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/all.js#xfbml=1&appId=YourAppIdHere";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
there was white space in your fb url for the target page.
<div id="fb_like">
<fb:like-box href="https://www.facebook.com/pages/Emma-Nolan-Mobile-Beauty-and-Holistic-Therapy/230397297018772" width="300" height="185" show_faces="true" stream="false" header="false" border_color="#FFFFFF"></fb:like-box>
</div>
I have also been dealing with this issue. Does the cient/business owner have any country or age restrictions set for their page? When demographic restrictions are set (allowing only visitors from a specific country for example, or excluding visitors from a specific country), the Fb like box will not display for non logged-in users. This is a consequence of setting demograhic restrictions and as far as i know cannot be resolved except by opening up the page and getting rid of all restrictions. Hope this helps. See similar thread here: Facebook Like Box plugin doesn't show up for logged out users; only for logged in users
I think you didn't included javascript sdk in your head tag ,resulting in improper fb like button rendering .