I have a form on a facebook page. seen here: http://o开发者_如何学Cn.fb.me/ocsqMR
It is an iframe tab but the form at the bottom is not rendering. When using IE8 or 9, the form does not appear. When using chrome, firefox, or safari, the form does appear. Using chrome I can see it when I do inspect element but it's there but not visible.
Ideas?
Looking at the source code for your page you need to make a few changes and additions.
Make sure you declare a DOCTYPE for the page. http://www.w3.org/QA/2002/04/valid-dtd-list.html
Next, remove the onLoad attribute from the body tag:
<Body onLoad="FB.Canvas.setSize({width: 515, height: 1350})"><Div id="fb-root"></div>`
And also, you'll need to update this code: Make sure you're using the app ID from https://developers.facebook.com/apps for your app. You'll also want to make sure the OAuth attribute is in your call.
<Script src="http://connect.facebook.net/en_US/all.js#xfbml=1″></script>
<Script type="text/javascript">
FB.init({
appId: FB_APP_ID,Status: true,Cookie: true,Xfbml: true
});
window.fbAsyncInit = function().{
fb.canvas.setautoresize();
}
</Script>
Here is an example of how it should look:
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: 'PUT THE APP ID FROM https://developers.facebook.com/apps HERE',
status: true, cookie: true,
xfbml: true, oauth: 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>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.Canvas.setAutoResize();
}
</script>
精彩评论