Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
MicrosoftArticlesForumsFAQs
C# .NET
VB.NET
Visual Studio .NET
ADO.NET
Xml / Xslt
VB 6.0
.NET CF
GDI+
LINQ
Deployment
Security
FoxPro
Silverlight / WPF
Entity Framework
RIA Services

WebArticlesForumsFAQs
JavaScript
ASP
ASP.NET
WCF

DatabasesArticlesForumsFAQs
SQL Server
Access
Oracle
MySQL
Other Databases

OfficeArticlesForumsFAQs
Excel
Word
Powerpoint
Outlook
Publisher
Money

Non-MicrosoftArticlesForumsFAQs
NHibernate
Perl
PHP
Ruby
Java
Linux / Unix
Apple
Open Source

Operating SysArticlesForumsFAQs
Windows 7
Windows Server
Windows Vista
Windows XP
Windows Update
MAC
Linux / UNIX

Server PlatformsArticlesForumsFAQs
BizTalk
Site Server
Exhange Server
IIS

Graphic DesignArticlesForumsFAQs
Macromedia Flash
Adobe PhotoShop
Expression Blend
Expression Design
Expression Web

OtherArticlesForumsFAQs
Lounge
Subversion / CVS
Ask Dr. Dotnetsky
Active Directory
Networking
Uninstall Virus
Job Openings
Product Reviews
Search Engines
Resumes

 

  View Other JavaScript Posts   Ask New Question  Ask New Question With Power Editor

how to pop a new window while closing a window
ashok kumar posted at Saturday, November 07, 2009 1:19 AM

hello !
   i want popup a window while closing current window
Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0
Pop-up Then Close
F Cali provided a rated reply to ashok kumar on Saturday, November 07, 2009 1: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

Reply    Reply Using Power Editor
How well do you know SQL? Find out with the free test assessment from SQL Server Helper:
http://www.sql-server-helper.com/free-test/default.aspx
  Rank Winnings Points
November 3 $65.00 168
October 0 $0.00 0

Re:
web mavin replied to ashok kumar on Saturday, November 07, 2009 1: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>');  
}

Reply    Reply Using Power Editor
  Rank Winnings Points
November 8 $22.00 56
October 7 $38.00 131

use onbeforeunload
mv ark provided a rated reply to ashok kumar on Saturday, November 07, 2009 8:26 AM

Call the pop up window using window.open() method in the onbeforeunload event of the body tag
Reply    Reply Using Power Editor
M.V. 'Anil' Radhakrishna is a seasoned developer and a Microsoft MVP (ASP/ASP.NET). He blogs his little discoveries and Web development tips, tricks and trivia quite regularly. You can find some of his unusual code samples & snippets at his Code Gallery.
  Rank Winnings Points
November 6 $46.00 119
October 4 $66.00 225

try this
Jack jack replied to ashok kumar on Tuesday, November 10, 2009 5: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()

Reply    Reply Using Power Editor
  Rank Winnings Points
November 16 $0.00 19
October 0 $0.00 0