-1

I am developing a Facebook application with FB JavaScript SDK. I need email permission on start of the application I am using OAuth Dialog. Here is the code:

<html xmlns:fb="https://www.facebook.com/2008/fbml">
  <body>
    <script src="http://connect.facebook.net/en_US/all.js"></script>
    <div id="fb-root"></div>
    <script>
      // assume we are already logged in
      FB.init({appId: '*************', xfbml: true, cookie: true, oauth: true});

      FB.login({
        scope: 'email,user_birthday',
      });
     </script>

     <a href="https://www.facebook.com/dialog/oauth/?
  scope=email,user_birthday&
  client_id=148244388606048&
  redirect_uri=https://apps.facebook.com/projectatestapp/test2.html&
  response_type=token"> test</a>
  </body>
</html>

But when I hit the URL https://apps.facebook.com/projectatestapp/test2.html, I see the test link. When I click at link some screen flashes and then I am directed to the Facebook page On which a big Facebook button is placed and when I click on that big fb icon button then I see the permission window

Now I dont know what I ma doing wrong as I dont want to see the big fb button in process of my application permission window. How to skip it?

ifaour
  • 38,035
  • 12
  • 72
  • 79
user958414
  • 385
  • 1
  • 5
  • 10

1 Answers1

0

Add the target="_top" attribute to your link <a>, this way the link will open on the top window instead of within the iframe.

ifaour
  • 38,035
  • 12
  • 72
  • 79
  • i have one more question :$ as now it works perfectly fine that the link direct to permission window and then allow button directs to my test2.html page .. but how to get the email id in test2.html page? – user958414 Oct 20 '11 at 11:51
  • How about trying a bit and then if you couldn't solve it asking a new question with the code you've tried and if you are using a server side technology or if only JS is used? :) – ifaour Oct 20 '11 at 12:57