title: Confusion over facebook JS SDK login
body: <p>I have two seperate js files, <strong>domready.js</strong> and <strong>fb-jssdk.js</strong>.</p>
  
  <p>The jssdk handles loading the sdk and login. It returns the correct state from response.state when the user is logged in or not depending on the scenario.</p>
  
  <p>What I am confused about is how I can use that obtained data from FB response and with the FB.api to get name and email when a user is logged in and use it on my site with jQuery.</p>
  
  <p><strong>Edit:</strong>
  I want to know how to use the content of response in a separate js file from the one that the fb code is in and use it with jQuery event handlers. </p>
  
  <p>So if I have a function called testAPI() which prints response.name to the console, how do I get the data of response.name = "Kryptonite Dove" to work with in the other file?</p>
  
  <p><strong>testAPI()</strong></p>
  
  <pre><code>function testAPI() {
  console.log('Welcome!  Fetching your information.... ');
  FB.api('/me', function(response) {
      console.log('Good to see you, ' + response.name + '.');
      var state = response.name;
      return response.name;
  
  });
  }
  </code></pre>
  
  <p><strong>some func</strong></p>
  
  <pre><code>   $("#id").click(function() {
        if (response.name == "Kryptonite Dove") {
          // Do something
        }
     });
  </code></pre>