I have a website that integrates a fan box and a few other things from facebook. to get everything to look right, i've implemented FBML as follows:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en" lang="en">
it does actually work just fine, except I've found that my client's company has a block in place on employees so they can't access Facebook. This however is causing the site to blow up and not load completely as the firewall won't allow the FB code on this site to fire correctly.
As I don't have this block in place, i'm having trouble replicating it remotely and haven't been able to pin point exactly what it's doing that's causing it to display incorrectly.
In short, is there something I can implement in the code to check and see if FB is accessible and only fire the fbml if it is? I'm using PHP and Jquery primarily for the site.
Thanks in advance.
edit: Code snippets as requested
From the beginning:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en" lang="en">
Then within the page calling a fanbox:
<div id="fbbox">
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<div id="fb-root">
<fb:fan profile_id="xxxxxxxx" width="235" height="200" connections="12" stream="false" header="false" css="http://www.xxxx.com/xxxx.css?33" ></fb:fan>
</div>
<script>
<!--
window.fbAsyncInit = function() {
FB.init({appId: 'xxxxxxx', status: true, cookie: false, 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>
I have xxx'ed out some of the specific settings, but I can assure you these are correct in the actual code.
If facebook.com is blocked for the user, the social plug-ins canot load anf therefore will not render on your site. You should check to see if the plug-ins load and if they do not replace the content with something that allows your site to continue to function without them.
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