我正在使用Google应用程序引擎和google web工具构建一个web应用程序。我曾尝试使用html实现Facebook登录页面。所以我有自己的登录和注册系统,还有Facebook登录系统。问题是,一旦一个人通过Facebook登录,它只是停留在主登录页面,而我想让它转到主页面。我不得不把一些代码直接转到主页,但我不知道该把html放在哪里。
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'This is where My App ID was...', // App ID
channelUrl : '//www.Icannnotshowyou.com/', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
//put something here?
});
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
<div class="fb-login-button">Login with Facebook</div>
</body>
</center>发布于 2012-12-27 18:28:26
我想您一定是在创建facebook应用程序时设置了回调url,该应用程序会将您重定向到该url,在我的示例中,该url是一个servlet,它完成了对graph对象的所有处理,然后我返回了一个字符串作为响应,该字符串由嵌入在我的html head标记中的js函数处理。进一步使用这个字符串,我将调用重定向到其他页面。
https://stackoverflow.com/questions/11351352
复制相似问题