Nic*_*ngs 2 facebook facebook-javascript-sdk facebook-authentication
这似乎在我没有任何改变的情况下发生.突然之间,除Chrome之外的任何浏览器都没有处理fb:login-button标签,它只是将标签中的任何文本显示为纯文本.
在网上搜寻几个小时,寻找可能的原因/解决方案后,我发现没有任何解决这种特殊行为的方法.
所以,我已经创建了最基本的例子来说明问题,并把它放在这里:http: //silverbucket.net/examples/fblogin/welcome.htm
上面的示例显示了Chrome中的fb-login框,但不包括Firefox,IE或Opera.
总结一下,上面链接页面中的内容,首先是顶部的html标签:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" lang="en">
Run Code Online (Sandbox Code Playgroud)
在我的头脑中:
<script src="http://connect.facebook.net/en_US/all.js"></script>
Run Code Online (Sandbox Code Playgroud)
在身体中,我的头部正下方:
<div id="fb-root"></div>
Run Code Online (Sandbox Code Playgroud)
然后是实际的fb-login-button:
<fb:login-button scope="email, user_interests, user_likes, publish_stream">log in with facebook</fb:login-button>
Run Code Online (Sandbox Code Playgroud)
而且,在页面底部,就在关闭body标签之前,我有FB JavaScript:
<script>
$(document).ready(function() {
window.fbAsyncInit = function() {
FB.init({
appId : '153787078069017',
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
//channelUrl : '/channel.html', // channel.html file
oauth : true, // enable OAuth 2.0
status : false
});
// whenever the user logs in, we refresh the page
FB.Event.subscribe('auth.login', function(response) {
if (response.authResponse) {
window.location.href="http://example.com/fblogin";
}
});
};
(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>
Run Code Online (Sandbox Code Playgroud)
没有什么复杂的...它不仅仅发生在我的Firefox上,而是我所检查过的每一位同事.
我建议搬到window.fbAsyncInit = function() { 外面$(document).ready(function() {.这应该为浏览器提供更一致的浏览器结果.
| 归档时间: |
|
| 查看次数: |
5156 次 |
| 最近记录: |