473,387 Members | 1,420 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.

window.opener.close() and Internet Explorer 6

I fear this may be a FAQ - in which case my apologies - but I've failed
to track the answer down.

I want to close a window from another window it opened. I assumed that

this.window.opener.close();

would work, and it does work with my Netscape 6; but my IE 6 gives me an
error-message, "this.window.opener is null or not an object".

Is there some code which will work with both browsers?

--
Best wishes,

Geoff Wilkins
Ge****@wordsmith.demon.co.uk
Jul 23 '05 #1
2 12262
Geoff Wilkins wrote:
I fear this may be a FAQ - in which case my apologies - but I've failed
to track the answer down.

I want to close a window from another window it opened. I assumed that

this.window.opener.close();

would work, and it does work with my Netscape 6; but my IE 6 gives me an
error-message, "this.window.opener is null or not an object".

Is there some code which will work with both browsers?


This works in my IE6 Netscape7:

window.opener.opener = top;
window.opener.close()

Found here;

http://www.quirksmode.org/js/croswin.html

Mike

Jul 23 '05 #2
mscir wrote:
Geoff Wilkins wrote:
I fear this may be a FAQ - in which case my apologies - but I've
failed to track the answer down.

I want to close a window from another window it opened. I assumed that

this.window.opener.close();

would work, and it does work with my Netscape 6; but my IE 6 gives me
an error-message, "this.window.opener is null or not an object".

Is there some code which will work with both browsers?

This works in my IE6 Netscape7:

window.opener.opener = top;
window.opener.close()

Found here;

http://www.quirksmode.org/js/croswin.html

Mike


Sorry I goofed, that only works on my IE6.

Mike

Jul 23 '05 #3

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

Similar topics

2
by: Stefan Sch?rmeli | last post by:
I already read about several problems using firefox and the window.opener property. But obviously it didn't help out. So here is my problem: I got a "Search..." link which opens a new window...
2
by: RWC | last post by:
Hello, I am new to JavaScript but until now, have felt my way along fairly successfully. I have a page showing an image to the user. I use window.open to open a separate page, listing a bunch...
10
by: Shang Wenbin | last post by:
Hi, When I want to close the current window using window.close() in IE6.0, there will be a confirm box that: The web page you are viewing is trying to close the window. Do you want to close this...
7
by: MrFez | last post by:
Through some investigation it appears that selecting "Every visit to the page" for the IE caching setting "Check for new version of stored pages" causes the window.opener property of child windows...
8
by: Luke Matuszewski | last post by:
I have read all posts about how to detect that url have changed to new page and trigger the event handler then eg. function aidLogout(evt) { if(evt) { /* maybe via analyse of evt object i can...
2
by: jackson2005 | last post by:
OK, I need to do three different things. On the ONLOAD event I would like a popup box to open. In this popup box I need two text boxes. One for the UserName and one for the BillingTo name. ...
37
by: Jan Tovgaard | last post by:
Hey everyone:) We have a critical problem, which I can see that other people also has ran into. In Internet Explorer 7 it is no longer possible to do a window.close after opening a window,...
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...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.