Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
198 views
in Technique[技术] by (71.8m points)

Facebook (JavaScript) permission dialog for email - Error

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...