LinkedIn 注销功能
我是 linkedin 开发者网络的新手,我使用 linkedin javascript api 来登录用户。 我想知道如何注销用户。我知道它与 IN.User.logout() 命令有关,但我不太知道如何使用它。 我希望用户在浏览器关闭时自动注销。所以我将以下代码放入我的标题中:
<script type="text/javascript">
$(window).unload(function() {
IN.User.logout();
});
</script>
但这没有做任何事情。 linkedin 开发者网络上的教程不是很好,我无法从他们的论坛中得到很好的答案。 有人玩过 linkedin javascript 吗? 谢谢。
I'm sort of new to the linkedin developer network, and I got the linkedin javascript api to log a user in.
What i'm wondering about is how to log a user out. i know it has something to do with the IN.User.logout() command, but I don't quite know how to use it.
I want the user to be logged out automatically when the browser closes. So I put the following code in my header:
<script type="text/javascript">
$(window).unload(function() {
IN.User.logout();
});
</script>
But that didn't do anything.
The tutorial on the linkedin developer network wasn't very good, and I couldn't get a good answer from their forums.
Has anyone played around with the linkedin javascript?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据官方文档(搜索“Log the user out”)函数签名是:
IN.User.logout(callbackFunction,callbackScope)
所以你不只是调用它并关闭浏览器,你应该等待callbackFunction返回然后关闭浏览器。
另外,不让用户随时关闭窗口/选项卡很糟糕。请考虑一下
注销
链接或其他东西。As per the official docs (search for "Log the user out") the function signature is:
IN.User.logout(callbackFunction, callbackScope)
So you don't just call it and close the browser, you should wait for the
callbackFunction
to return and then close the browser.Also, not letting the user close the window/tab whenever he/she wants sucks. Please think about a
logout
link or something.这对我来说效果很好。
This worked fine for me.