我在 IE9 中让我的喜欢按钮工作时遇到了严重的问题。它在 Chrome 和 Firefox 中运行良好,但在 IE9 中,当我单击“赞”或“发送”一个新窗口时会打开。我用谷歌搜索了这个问题,发现了一些类似的帖子,但没有解决我的问题。我刚刚注意到我的站点和我的开发人员环境都包含在 IE 受信任站点中,因此被标记为不使用保护模式。打开保护模式后,它可以工作。
所以我去FB看看我是否可以在http://developers.facebook.com/bugs报告错误但找不到真正发布错误的地方 - 只能浏览。因此,除了发布此信息以将我的发现告知其他开发人员之外 - 任何人都可以指出我发布错误报告的正确方向。试图谷歌它,但没有。
最佳答案
我的一切似乎都运行良好。
我只能建议
https://developers.facebook.com/docs/reference/javascript/
这是我如何使用解析 xfbml 和异步 javascript 呈现登录按钮的示例。
<div id="loginbutton"></div>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '135669679827333',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
channelUrl : 'https://anotherfeed.com/emo/channel.html', // channel.html file
oauth : true // enable OAuth 2.0
});
function loginbutton(){
var loginb=document.getElementById('loginbutton');
loginb.innerHTML='<div class="fb-login-button" data-show-faces="false" data-width="200" data-max-rows="1" data-autologoutlink="true" data-scope="read_stream,user_likes,publish_stream,publish_actions,read_friendlists,user_photos,user_groups,user_interests,user_videos"></div>';
FB.XFBML.parse(loginb);
};
loginbutton();
};
// Load the SDK Asynchronously
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=135669679827333";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
关于internet-explorer - IE9 和 HTML5 以及 XFBML 之类的按钮在 IE 保护模式下不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10088195/