From c2ba07ed4267ffd575c141c4dcbce71c7e8b719b Mon Sep 17 00:00:00 2001 From: Titouan Rigoudy Date: Mon, 28 Jul 2014 22:03:29 -0400 Subject: [PATCH] Added jQuery --- fb.js | 10 ++++------ index.html | 5 ++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/fb.js b/fb.js index 44c83b3..a47d6f8 100644 --- a/fb.js +++ b/fb.js @@ -11,13 +11,11 @@ function statusChangeCallback(response) { testAPI(); } else if (response.status === 'not_authorized') { // The person is logged into Facebook, but not your app. - document.getElementById('status').innerHTML = 'Please log ' + - 'into this app.'; + $('#status').html('Please log into this app.'); } else { // The person is not logged into Facebook, so we're not sure if // they are logged into this app or not. - document.getElementById('status').innerHTML = 'Please log ' + - 'into Facebook.'; + $('#status').html('Please log into Facebook.'; } } @@ -72,8 +70,8 @@ function testAPI() { console.log('Welcome! Fetching your information.... '); FB.api('/me', function(response) { console.log('Successful login for: ' + response.name); - document.getElementById('status').innerHTML = - 'Thanks for logging in, ' + response.name + '!'; + $('#status').html( + 'Thanks for logging in, ' + response.name + '!'); }); } diff --git a/index.html b/index.html index 19898d5..15f15ff 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,10 @@ - + +