473,387 Members | 1,603 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,387 software developers and data experts.

close a window

I open page 1 and page 2 from main page. I want to close page 2 from
page 1 after I finish processing some work in page 1. Does anyone
know how to do that?

Thanks,

Jenny
Jul 20 '05 #1
7 5149
DU
Jenny wrote:
I open page 1 and page 2 from main page. I want to close page 2 from
page 1 after I finish processing some work in page 1. Does anyone
know how to do that?

Thanks,

Jenny


Jenny, you need to give more details, explanations. Usually, in web
programming newsgroups such as this one, the *best* is to provide an url
so that regulars of this newsgroup and javascript experts can see the
page: these people can examine, understand your pages' logic as fast as
you can read the newspapers' headlines.

Here, I don't know if the opener opens page1 and then page1 opens page2
and how these pages are opened: automatically? via target attribute or
via window.open()? And if you opened these or 1 of the 2 with
window.open(), then how you coded all this.. etc.etc..

An url is best to figure this out or sufficient chunks of relevant code.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/

Jul 20 '05 #2
I'm assuming that page 1 is opening the page 2 and page 3. If this is the
case, then you could probably just get page 3 to call a function in page 1
to do the close other wise you will probably get a security error message as
you can't close a page from javascript on a page that didn't open the page
in the first place. Need user authorisation to proceed with it.

on page 3...

window.opener.myClose();

function myClose() {
page1.close();
}

Not easy to describe this, but I hope you get the idea.

Peter.

"DU" <dr*******@hotREMOVEmail.com> wrote in message
news:bf**********@news.eusc.inter.net...
Jenny wrote:
I open page 1 and page 2 from main page. I want to close page 2 from
page 1 after I finish processing some work in page 1. Does anyone
know how to do that?

Thanks,

Jenny


Jenny, you need to give more details, explanations. Usually, in web
programming newsgroups such as this one, the *best* is to provide an url
so that regulars of this newsgroup and javascript experts can see the
page: these people can examine, understand your pages' logic as fast as
you can read the newspapers' headlines.

Here, I don't know if the opener opens page1 and then page1 opens page2
and how these pages are opened: automatically? via target attribute or
via window.open()? And if you opened these or 1 of the 2 with
window.open(), then how you coded all this.. etc.etc..

An url is best to figure this out or sufficient chunks of relevant code.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/

Jul 20 '05 #3

"Jenny" <je***************@yahoo.com> wrote in message
news:b4**************************@posting.google.c om...
I open page 1 and page 2 from main page. I want to close page 2 from
page 1 after I finish processing some work in page 1. Does anyone
know how to do that?

Thanks,

Jenny

http://mosley.arach.net.au/test/windows.htm
Jul 20 '05 #4
Nice...but maybe you could help me....

I have also a window opener and a function like this...

function alert_message()
{
if(!popup && !popup.open && popup.closed) alert("Don't forget to
refresh!");
}

and I call that function from child window with:

body onunload="document.opener.alert_message()">

but I don't get alert message when I close a child window...

any suggestions ???

respect...

"Mosley Jones III" <me@info.gov.mars> wrote in message
news:3f********@funnel.arach.net.au...

"Jenny" <je***************@yahoo.com> wrote in message
news:b4**************************@posting.google.c om...
I open page 1 and page 2 from main page. I want to close page 2 from
page 1 after I finish processing some work in page 1. Does anyone
know how to do that?

Thanks,

Jenny

http://mosley.arach.net.au/test/windows.htm

Jul 20 '05 #5
"point" <po***@caanproduction.com> wrote in message
news:bf*********@enews2.newsguy.com...
<snip>
and I call that function from child window with:

body onunload="document.opener.alert_message()">

but I don't get alert message when I close a child window...

<snip>

opener is not a property of the document object, it is a property of the
global (window) object. So:-

onunload="opener.alert_message();"
-or-
onunload="window.opener.alert_message();"

- should work better.

Ricahrd.
Jul 20 '05 #6

"point" <po***@caanproduction.com> wrote in message
news:bf*********@enews2.newsguy.com...
Nice...but maybe you could help me....

I have also a window opener and a function like this...

function alert_message()
{
if(!popup && !popup.open && popup.closed) alert("Don't forget to
refresh!");
}

and I call that function from child window with:

body onunload="document.opener.alert_message()">

window.operner not document
but I don't get alert message when I close a child window...

any suggestions ???

respect...

"Mosley Jones III" <me@info.gov.mars> wrote in message
news:3f********@funnel.arach.net.au...

"Jenny" <je***************@yahoo.com> wrote in message
news:b4**************************@posting.google.c om...
I open page 1 and page 2 from main page. I want to close page 2 from
page 1 after I finish processing some work in page 1. Does anyone
know how to do that?

Thanks,

Jenny

http://mosley.arach.net.au/test/windows.htm


Jul 20 '05 #7
Hy guys...

thanx for the help...

I tried this:
onunload="opener.alert_message();"

and got the error: popup in undefined???

I opened a window using this:

function popUp(URL)
{
openwindow=window.open(URL, 'popup',
'toolbar=0,scrollbars=1,location=0,statusbar=0,men ubar=0,resizable=0,width=3
00,height=400,top=0,left=0');
}

respect...
"Richard Cornford" <ri*****@litotes.demon.co.uk> wrote in message
news:bf**********@titan.btinternet.com...
"point" <po***@caanproduction.com> wrote in message
news:bf*********@enews2.newsguy.com...
<snip>
and I call that function from child window with:

body onunload="document.opener.alert_message()">

but I don't get alert message when I close a child window...

<snip>

opener is not a property of the document object, it is a property of the
global (window) object. So:-

onunload="opener.alert_message();"
-or-
onunload="window.opener.alert_message();"

- should work better.

Ricahrd.

Jul 20 '05 #8

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

Similar topics

3
by: J P Singh | last post by:
Hi Guys Wonder if someone can help me with this. I have a form where a user clicks a button which gives them a pop up windows to allow them to add the data. The user adds the data and click...
4
by: John H. | last post by:
Hello I have some trouble in closing a window, Here is the problem: I develop a asp.net website use client side valiation <asp:CustomValidator id="CustomValidator1"...
9
by: Graham | last post by:
What I currently have is a page that opens another browser at 800x600, once that is loaded I would like to close the orginal page down while keeping the page that it has just opened open (To make...
6
by: marcelf3 | last post by:
Hello.. This page opens a window with some information, but everytime the user changes a field in the parent window, the child window needs to be closed. These 2 functions were supposed to do the...
4
by: GrantS | last post by:
I am having a problem closing a popup window opened modally. When I try to close the window (when the user hits save button and the data has been processed), the Popup window opens as a full screen...
5
by: lindanr | last post by:
In ASP.NET 2005 I have an onblur="window.close()" javascript event in the <body> tag. When I click on the window's scrollbar, the window closes. The same code works fine in ASP.NET 2003. Any...
9
by: Stan B | last post by:
I create a popup window by calling window.showModalDialog Popup window has Ok button with this code attached: === string Script = "<script language=JavaScript>" + "{" + "window.close();" +...
7
by: Toccoa | last post by:
After considerable googling - I mean searching with Google(r) - I could not find javascript on a button or <a href=... to close a window in the latest versions of IE and FireFox. There seemed...
2
by: kurt sune | last post by:
Hello, I have a weird problem, I hope someone can explain this for me. I have a webpage using masterpage. In it I create a popup window using this code: Dim js As String = "<script...
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
I am looking for a java script to close a web form that I can attatch to a button click event. I am using vs2005, c#. Thanks -- Paul G Software engineer.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.