Facebook application 开发一 Login
生活随笔
收集整理的這篇文章主要介紹了
Facebook application 开发一 Login
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
無聊。。。好久沒寫blog了。。。 1. 引用 javascript <script src=" http://connect.facebook.net/en_US/all.js" type="text/javascript"></script> 2. 添加一個login button <a href="#" id="FacebookLogin">login as facebook user</a> 3.注冊javascript 事件? (對了 這個app id 你要去facebook 新建一個應用才會分配給你) $(document).ready( function () {
FB.init({
appId: ' app id ' ,
status: true , // check login status
cookie: true , // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
$( " #FacebookLogin " ).click( function () {
FB.login( function (response) {
if (response.session) {
// success
} else {
// failed
}
});
});
}
FB.init({
appId: ' app id ' ,
status: true , // check login status
cookie: true , // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
$( " #FacebookLogin " ).click( function () {
FB.login( function (response) {
if (response.session) {
// success
} else {
// failed
}
});
});
}
轉載于:https://www.cnblogs.com/PurpleTide/archive/2011/06/16/2083116.html
總結
以上是生活随笔為你收集整理的Facebook application 开发一 Login的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 淘宝获取sku详情接口工具
- 下一篇: VINS-Mono翻译