473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Closing popup

Hello,

I have an aspx app that executes the window.open to open a popup windows,
but is there an easy way to close the popup? (I can't find a window.close
method)

Thanks!
Nov 18 '05 #1
4 1331
Last time I needed to do this, this is how I did it. I think it should still
work.

When you pop-up your window, assign the window.open function to a variable:

var childWin;
childWin = window.open('newwindow.htm', 'PopUp', etc....);
Then, when you need to close it, (I'm assuming from the parent window that
opened it in the first place):

if(childWin && !childWin.closed) //make sure it is not null, and it is not
already closed.
{
childWin.close();
}
-Darrin


"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
Hello,

I have an aspx app that executes the window.open to open a popup windows,
but is there an easy way to close the popup? (I can't find a window.close
method)

Thanks!

Nov 18 '05 #2
I'm sorry, I should have specified that there is a button in the child
window that will close it. The parent won't be doing it.

Thanks!

"Darrin J Olson" <da************@sio.midco.net> wrote in message
news:eY**************@TK2MSFTNGP12.phx.gbl...
Last time I needed to do this, this is how I did it. I think it should still work.

When you pop-up your window, assign the window.open function to a variable:
var childWin;
childWin = window.open('newwindow.htm', 'PopUp', etc....);
Then, when you need to close it, (I'm assuming from the parent window that
opened it in the first place):

if(childWin && !childWin.closed) //make sure it is not null, and it is not already closed.
{
childWin.close();
}
-Darrin


"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
Hello,

I have an aspx app that executes the window.open to open a popup windows, but is there an easy way to close the popup? (I can't find a window.close method)

Thanks!


Nov 18 '05 #3
Oh, sorry man. Kinda' went overboard there.

There is a window.close() method to close the window. I assumed you were
doing a child window since you had mentioned the window.close below! :-)

In your OnClick event for the button, do:

window.close();

-Darrin
"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I'm sorry, I should have specified that there is a button in the child
window that will close it. The parent won't be doing it.

Thanks!

"Darrin J Olson" <da************@sio.midco.net> wrote in message
news:eY**************@TK2MSFTNGP12.phx.gbl...
Last time I needed to do this, this is how I did it. I think it should

still
work.

When you pop-up your window, assign the window.open function to a

variable:

var childWin;
childWin = window.open('newwindow.htm', 'PopUp', etc....);
Then, when you need to close it, (I'm assuming from the parent window that
opened it in the first place):

if(childWin && !childWin.closed) //make sure it is not null, and it is

not
already closed.
{
childWin.close();
}
-Darrin


"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
Hello,

I have an aspx app that executes the window.open to open a popup

windows, but is there an easy way to close the popup? (I can't find a window.close method)

Thanks!



Nov 18 '05 #4
Yeah, that did it. Thanks for the help!!

I didn't see a window.close method in my help so I just assumed it was't
available.

Thanks again!!

"Darrin J Olson" <da************@sio.midco.net> wrote in message
news:eG**************@tk2msftngp13.phx.gbl...
Oh, sorry man. Kinda' went overboard there.

There is a window.close() method to close the window. I assumed you were
doing a child window since you had mentioned the window.close below! :-)

In your OnClick event for the button, do:

window.close();

-Darrin
"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I'm sorry, I should have specified that there is a button in the child
window that will close it. The parent won't be doing it.

Thanks!

"Darrin J Olson" <da************@sio.midco.net> wrote in message
news:eY**************@TK2MSFTNGP12.phx.gbl...
Last time I needed to do this, this is how I did it. I think it should

still
work.

When you pop-up your window, assign the window.open function to a

variable:

var childWin;
childWin = window.open('newwindow.htm', 'PopUp', etc....);
Then, when you need to close it, (I'm assuming from the parent window that opened it in the first place):

if(childWin && !childWin.closed) //make sure it is not null, and it
is not
already closed.
{
childWin.close();
}
-Darrin


"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I have an aspx app that executes the window.open to open a popup

windows,
> but is there an easy way to close the popup? (I can't find a

window.close
> method)
>
> Thanks!
>
>



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: MJEASSOC | last post by:
I need some help with closing a popup window. I'm making an online portfolio, that has one base page with text and thumbnails. When a user clicks on a thumb, a new window opens containing a larger...
7
by: E Michael Brandt | last post by:
I have been lurking here for some time, and now would like to ask a question of you clever coders: My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the face of the new Opera...
4
by: bbass | last post by:
thanks to all that replyied to my previous post with the following code in question: <a href="merc.htm" target="_new_merc" onfocusout=window.close class="left_link"> i understand that the...
4
by: deko | last post by:
I have a pop-up form in which user-defined parameters are entered. The parameters are entered into a subform datasheet which is bound to a table. I need to check the product of two parameters to...
1
by: sunilborkar | last post by:
Hello, I want to open the unblockable PopUp Window after closing the Internet Explorer Window and also when I go back to previous page. I know how to create the Unblockable PopUp window. Only I...
4
by: rdemyan | last post by:
I'm using code from the following web page to open the API Browse Folder dialog http://www.mvps.org/access/api/api0002.htm It all works fine. But if the dialog box is open and the user closes...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
3
by: =?Utf-8?B?Vk1J?= | last post by:
How can I close popup window automatically when I close the parent window (the application itself)? Thanks.
3
by: Mike Hofer | last post by:
Okay, here's the situation: we want to be able to display ASPX pages in an UpdatePanel. The reasons for this are performance related. The site in development uses *lots* of modal popups from some...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.