Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 201cbbd

Browse files
authored
Create fbaddedfile.js
1 parent 4f5cd48 commit 201cbbd

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
///<reference path="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js" />
2+
///<reference path="http://connect.facebook.net/en_US/all.js" />
3+
4+
// initialize the library with the API key
5+
FB.init({ appId: '349900301735115' });
6+
7+
// fetch the status on load
8+
FB.getLoginStatus(handleSessionResponse2);
9+
10+
$('#login').bind('click', function () {
11+
FB.login(handleSessionResponse);
12+
});
13+
14+
$('#logout').bind('click', function () {
15+
FB.logout(handleSessionResponse);
16+
});
17+
18+
function handleSessionResponse2() { }
19+
// handle a session response from any of the auth related calls
20+
function handleSessionResponse() {
21+
FB.api('/me', function (response) {
22+
console.dir(response);
23+
//$('#user-info').html(response.id + ' - ' + response.name);
24+
});
25+
FB.api('/me/picture', function (response) {
26+
console.dir(response);
27+
var img = document.createElement('img');
28+
img.src = response;
29+
document.body.appendChild(img);
30+
});
31+
}

0 commit comments

Comments
 (0)