views:

67

answers:

1

I've been using FB Connect for some time now. The code below has worked fine since I first implemented it.

In the last week I did some server configurations to enable mod_deflate and it has stopped working. Comments work, only the callback function has stopped working.

Has anyone had a similar experience? Can anyone recommend a solution?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" 
"http://www.w3.org/TR/html4/frameset.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&gt;
<head>
</head>
<body>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<fb:comments></fb:comments>
<script type="text/javascript" language="JavaScript">
FB_RequireFeatures(["XFBML"], function(){
  FB.Facebook.init("myapikeygoeshere", "{site_url}connect/xd_receiver.htm");
  FB_RequireFeatures(["Comments"], function() {
    FB.CommentClient.add_onComment(function(comment){
      alert("after");
    });
  });    
});
</script>
</body>
</html>

Here are some helpful links:

http://drupal.org/node/715862 http://www.daffodilsw.com/blog/2009/11/Add-Facebook-Comment-box-in-Site.html http://developers.facebook.com/docs/reference/fbml/

+1  A: 

The solution:

Upgrade to the newer version of the SDK. The older one has bugs...

In the new version this would go like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" 
"http://www.w3.org/TR/html4/frameset.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&gt; 
<head>
</head>
<body>
<fb:comments xid="1" canpost="true" candelete="true" numposts="10" showform="true" notify="true" returnurl="[[my url goes here]]">
</fb:comments> 
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt;
<script>
  FB.init({
        appId : "[[my app id goes here]]",
        status: true,   
        cookie: true,
        xfbml : true
  });
  FB.Event.subscribe('comments.add',function(resp){
    alert('comment added');
  });
</script>
</body>
</html>
akellehe