Facebook gurus,
I have been implementing the Facebook Like button for a number of clients lately. To enable the Like Button, the following script has to be run:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: '<?php echo Mage::helper("evlike")->getLikeConfig("ev_facebook_app_id") ?>',
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>
It seems that this is incompatible with the following include:
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script>
It would make sense as I believe that the FeatureLoader performs a开发者_如何学Gon initialization. Is this official now? I would ask in official Facebook forums but I get an error every time I attempt to do so...
Found the answer here: http://wiki.developers.facebook.com/index.php/Connect/Setting_Up_Your_Site
According to them: "Important: You need to reference the FeatureLoader script only once on a page. If you already have a Facebook Connect social widget on this page, you don't need to reference the FeatureLoader script again."
I would have been able to find that earlier but their wiki has been a real mess lately. Up, down, and all around.
精彩评论