1
1
"use strict" ;
2
2
3
- window . fbAsyncInit = function ( ) {
4
- FB . init ( {
5
- appId : '932297393472020' ,
6
- xfbml : true ,
7
- version : 'v2.5'
8
- } ) ;
3
+ window . onload = function ( ) {
4
+ window . fbAsyncInit = function ( ) {
5
+ FB . init ( {
6
+ appId : '932297393472020' ,
7
+ xfbml : true ,
8
+ version : 'v2.5'
9
+ } ) ;
9
10
} ;
10
11
11
- ( function ( d , s , id ) {
12
- var js , fjs = d . getElementsByTagName ( s ) [ 0 ] ;
13
- if ( d . getElementById ( id ) ) { return ; }
14
- js = d . createElement ( s ) ; js . id = id ;
15
- js . src = "//connect.facebook.net/en_US/sdk.js" ;
16
- fjs . parentNode . insertBefore ( js , fjs ) ;
17
- } ( document , 'script' , 'facebook-jssdk' ) ) ;
12
+ ( function ( d , s , id ) {
13
+ var js , fjs = d . getElementsByTagName ( s ) [ 0 ] ;
14
+ if ( d . getElementById ( id ) ) {
15
+ return ;
16
+ }
17
+ js = d . createElement ( s ) ; js . id = id ;
18
+ js . src = "//connect.facebook.net/en_US/sdk.js" ;
19
+ fjs . parentNode . insertBefore ( js , fjs ) ;
20
+ } ( document , 'script' , 'facebook-jssdk' ) ) ;
18
21
19
- var accessKey ;
20
-
21
- function statusChangeCallback ( response ) {
22
-
23
- if ( response . status === 'connected' ) {
24
- console . log ( "connected!" ) ;
22
+ var accessKey ;
23
+
24
+ function statusChangeCallback ( response ) {
25
+
26
+ if ( response . status === 'connected' ) {
27
+ console . log ( "connected!" ) ;
25
28
// Logged into your app and Facebook.
26
29
accessKey = response . authResponse . accessToken ;
27
- } else if ( response . status === 'not_authorized' ) {
28
- console . log ( "needs to log into app" ) ;
29
- } else {
30
- console . log ( "needs to log into fb" ) ;
31
- }
32
- }
30
+ } else if ( response . status === 'not_authorized' ) {
31
+ console . log ( "needs to log into app" ) ;
32
+ } else {
33
+ console . log ( "needs to log into fb" ) ;
34
+ }
35
+ }
33
36
34
- function checkLoginState ( ) {
35
- FB . getLoginStatus ( function ( response ) {
36
- statusChangeCallback ( response ) ;
37
- } ) ;
38
- }
37
+ function checkLoginState ( ) {
38
+ FB . getLoginStatus ( function ( response ) {
39
+ statusChangeCallback ( response ) ;
40
+ } ) ;
41
+ }
42
+ } ;
0 commit comments