hi all,
i open a window from my parent window like this
window.open('../stationary/x_students_mailshots_csv.php', 'csv_create', 'top=0,left=0,location=1,menubar=0,resizable=0,scrollbars=no,status=0,toolbar=0,width=5,height=5');
the x_students_mailshots_csv.php file has the ob_start(); function for creating an excel file and downloading it on your machine. so when this window opens a download dialogue box appears.
my problem is when the user downloads the created excel file the open window cannot be closed. why?
i used
csv_create.close()
in both parent and child window and it does not work.
closing a window
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
You need identify the new window with a variable.
Code: Select all
var newWindow = window.open('../stationary/x_students_mailshots_csv.php', 'csv_create', 'top=0,left=0,location=1,menubar=0,resizable=0,scrollbars=no,status=0,toolbar=0,width=5,height=5');
//then to close it
newWindow.close()