javascript - How to close popup window and redirect the parent window -


string dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" + app_id + "&redirect_uri=" + server.urlencode(my_url) + "&scope=" + permission; clientscript.registerclientscriptblock(typeof(page), "key", "window.open('"+dialog_url+"','_parent','');");

i use code popup permission dialog. when user click allow facebook redirect user app in popup. need send code popup window parent window close popup when user click allow.

tell me if looking for... parent window:

<html> <head>      <script language="javascript">          function showfbwindow(){             url = "allowfbchild.html"             newwindow=window.open(url,'name','height=200,width=150');             if (window.focus) {newwindow.focus()}         }      </script>  </head> <body>      <input type="button" onclick="showfbwindow()" value="open fb" />  </body> </html> 

child window(allowfbchild.html) :

<html> <head>      <script language="javascript">          function redirecttofb(){             window.opener.location.href="http://wwww.facebook.com";             self.close();         }      </script>  </head> <body>      allow user view fb     <br/>are sure?     <input type="button" value="ok" onclick="redirecttofb()" />  </body> </html> 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -