title: Making client side authorization to Facebook using Javascript JQuery
body: <p>Here is what I want to:
  I used OAuth 2.0 authorization system.
  I already registered my application in Facebook, and I have got my application secret keys (i did server side code, but I need more user friendy authorization system).</p>
  
  <p>Based on response from Facebook, how can I get response code from Facebook without reloading the page? In case you didn't understand what I mean take a look on next example:</p>
  
  <p>Example is on this link:
  <a href="http://www.badminton.si/1-turnir-b-kategorije-1-kolo-mbl" rel="nofollow">http://www.badminton.si/1-turnir-b-kategorije-1-kolo-mbl</a></p>
  
  <p>How can I then continue to get my access token so I can access my private information (like email)?</p>
  
  <p>IN SHORT:</p>
  
  <pre><code>&lt;script type="text/javascript" src="../Scripts/jquery-1.4.1-vsdoc.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://static.ak.fbcdn.net/connect/en_US/core.debug.js"&gt; &lt;/script&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&gt;
  FB.init({
    appId: my_api_key,
    status: true,
    cookie: true,
    xfbml: true
  });
  FB.Event.subscribe('auth.login', function (response) {login();)}
  FB.Event.subscribe('auth.logout', function (response) {logout();});
  FB.getLoginStatus(function (response) {if (response.session) {login();}});
  function login() {FB.api('/me', function (response) {alert(response.email)});
  ....
  
  &lt;fb:login-button v="2" size="large" autologoutlink="true" perms="email,user_birthday,status_update,publish_stream,read_stream"&gt;
  &lt;/fb:login-button&gt;
  </code></pre>