Thursday, February 24, 2011

FB.Event.subscribe is not working in IE

The code that I am using is this:

<script src="http://connect.facebook.net/en_GB/all.js#xfbml=1"></script>
<script>
$(document).ready(function(){
    FB.Event.subscribe('edge.create', function(response) {
        window.location= 'likeApp.php';
    });
});
</script>

The above code works fine in all browsers except IE.

After searching I came to know that we must add the fb-root element just after the body tag (Make sure this tag is right after your body tag):
<div id="fb-root"></div>

Hope this helps :)

4 comments:

Anonymous said...

Add this to the HTML-tag to make it work in IE:

xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraph.org/schema/" xml:lang="-yourlanguage-" lang="-yourlanguage-"

Ravi said...

Thanks for sharing :)

Anonymous said...

What do you have on likeApp.php?

Ravi said...

Hi,

"likeApp.php" is your next page that you want to render after clicking on FB LIKE button :)

Post a Comment