Last active
August 29, 2015 14:21
-
-
Save cypressyi/c0663dfa9b52d59e0a67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //wrong | |
| // function testAPI(callback) { | |
| // console.log('Welcome! Fetching your information.... '); | |
| // FB.api('/me', function(response) { | |
| // console.log('Successful login for: ' + response.name + "/" + response.gender); | |
| // // document.cookie = "username =" + response.name; | |
| // // document.cookie = "gender =" + response.gender; | |
| // // document.location.href = "testing.html?name=" + response.name + "?gender=" + response.gender; | |
| // localStorage.setItem("name", response.name); | |
| // localStorage.setItem("gender", response.gender); | |
| // }); | |
| // callback(); | |
| // } | |
| //right | |
| function testAPI(callback) { | |
| console.log('Welcome! Fetching your information.... '); | |
| FB.api('/me', function(response) { | |
| console.log('Successful login for: ' + response.name + "/" + response.gender); | |
| // document.cookie = "username =" + response.name; | |
| // document.cookie = "gender =" + response.gender; | |
| // document.location.href = "testing.html?name=" + response.name + "?gender=" + response.gender; | |
| localStorage.setItem("name", response.name); | |
| localStorage.setItem("gender", response.gender); | |
| callback(); | |
| }); | |
| } | |
| testAPI(function() { | |
| document.location.href = "testing.html"; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment