title: Using Facebook OAuth 2.0 - How do I fetch the access token?
body: <p>I am new to <a href="http://en.wikipedia.org/wiki/OAuth" rel="nofollow noreferrer">OAuth</a>, and I'm trying to use <a href="http://en.wikipedia.org/wiki/Facebook_Platform#Facebook_Connect" rel="nofollow noreferrer">Facebook Connect</a> with my web-application.</p>
  
  <p>I have succeded in getting a verification token, but my problem is "fetching" the access token. How do I fetch it? The Facebook documentation tells me to fetch the access token with this URL:</p>
  
  <pre><code>https://graph.facebook.com/oauth/access_token?'
                  + 'client_id=XXXXXXXXXXXX&amp; redirect_uri=http://www.mysite.com/fbconn/index.html&amp;display=touch&amp;'
                  + 'client_secret=axxxxxcxxxxxxxxxxx&amp;code=' + code;
  </code></pre>
  
  <p>When I use this I see the access token on a blank page, but I want to fetch it with JavaScript (Ajax), PHP or something. Is this possible? I thought the access token would be appended to my redirect URI like the verfication code, but I never get redirected to my page. What am I doing wrong?</p>