I know that you can close a window.open with window.close but is there another way. I have a popup that opens facebook connect and i want to shut the popup whenever the user connects to facebook and then refresh the parent window…I thought in the past i used
TARGET = "_top"
here is my code
$(document).ready(function(){
$('#signin_menu a').click(function (){
window.open(
$('#signin_menu a').attr("href"),
'mywindow',
'width=850,height=400'
);
return false;
});
})
Also
$('#signin_menu a').attr("href")
is equal to
"https://graph.facebook.com/oauth/authorize?client_id=145554402127660&display=popup&redirect_uri=http://pgp.dev/fb_receive&scope=publish_stream,rsvp_event,offline_access,email,user_about_me,user_activities,user_birthday,user_events,user_groups,user_interests,user_likes,user_location,user_notes,user_online_presence,user_photo_video_tags,user_status,user_website,read_friendlists"
So How do i close this popup
You can use close() method of created popup that is returned by the open() method as object:
To close do the following: