I'm trying to implement an XFBML comment box on a page. It works in FF and Chrome, but only sporadically in IE8.
I get an 'FB' is undefined error when the page hits the FB.XFBML.parse('fb-stuff'); Do I need to check if the FB Connect script has finished loading before I try to parse the XFBML?
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : '117378991625799',
status : false, // check login status
cookie : false, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
FB.XFBML.parse('fb-stuff');
}());
</script>