Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
141
rated 0 times [  146] [ 5]  / answers: 1 / hits: 80993  / 14 Years ago, sat, february 19, 2011, 12:00:00
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 this code for popup permission dialog. When user click allow facebook redirect user to my app in the popup. I need to send code from popup window to parent window then close popup when user click allow.


More From » facebook

 Answers
10

Tell me if this is what you are 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 the user to view FB
<br/>Are you sure?
<input type=button value=Ok OnClick=redirectToFB() />

</body>
</html>

[#93672] Thursday, February 17, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
juliettec

Total Points: 327
Total Questions: 127
Total Answers: 102

Location: Bangladesh
Member since Sat, Jan 23, 2021
3 Years ago
;