how to pop a new window while closing a window

Asked By ashok kumar
07-Nov-09 01:19 AM
Earn up to 0 extra points for answering this tough question.
hello !
   i want popup a window while closing current window

  Pop-up Then Close

F Cali replied to ashok kumar
07-Nov-09 01:51 AM

To pop-up a new window, you can use the window.open function.  Here's an example:

window.open ("http://www.sql-server-helper.com",
"sqlwindow","menubar=1,resizable=1,width=350,height=250");

Then to close the current window, just call window.close();

Regards,
SQL Server Helper

  Re:

web mavin replied to ashok kumar
07-Nov-09 01:55 AM

I think you could close the current window using self.close as this:-

<A href="javascript: self.close()">Close this Window</A>

And, open a new one using window.open("  "). Use it in a function like this:-

<SCRIPT language="JavaScript1.2">
function popuponclick()
{
 my_window = window.open("",
    "mywindow","status=1,width=350,height=150");
my_window.document.write('<H1>The Popup Window</H1>');  
}

  use onbeforeunload

mv ark replied to ashok kumar
07-Nov-09 08:26 AM
Call the pop up window using window.open() method in the onbeforeunload event of the body tag
  try this
Jack jack replied to ashok kumar
10-Nov-09 05:03 AM

for open window >>

window.open('http://www.pageresource.com/jscript/jex5.htm','mywindow','width=400,height=200,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,
resizable=yes')


For close current window >>

1.) window.close()
2.) self.close()

Create New Account