473,770 Members | 6,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opera - .closed not accessible if window is closed?

See: http://www.mattkruse.com/temp/window_closed.html

It looks like the .closed property of a window is inaccessible if the
window is actually closed. Other browsers have no problem detecting
that the window has been closed. Opera 7.11 and 7.20b7 both throw
errors when trying to check the .closed property.

Is this a bug in Opera, or do I have to (once again) take special
action to make normal javascript work with Opera?

Matt Kruse
(who still finds very few redeeming qualities in Opera...)
Jul 20 '05 #1
5 4418
On 7 Sep 2003 15:18:28 -0700, ma**@mattkruse. com (Matt Kruse) wrote:
See: http://www.mattkruse.com/temp/window_closed.html

It looks like the .closed property of a window is inaccessible if the
window is actually closed. Other browsers have no problem detecting
that the window has been closed. Opera 7.11 and 7.20b7 both throw
errors when trying to check the .closed property.

Is this a bug in Opera, or do I have to (once again) take special
action to make normal javascript work with Opera?

Matt Kruse
(who still finds very few redeeming qualities in Opera...)


From what I understand about the design philosophy of Opera, that is
so you won't pop up another annoying pop up in someones face. Cruising
the Opera forums, newsgroups, KB and bug reports will tell you for
sure. From a users point of view, Opera is pretty good, and definitely
a good alternative to the crap microsoft puts out.

Andy
-
"There would be a lot more civility in this world if people
didn't take that as an invitation to walk all over you"
- (Calvin and Hobbes)
Jul 20 '05 #2
"andy johnson" <an************ @chicagonet.net > wrote:
From what I understand about the design philosophy of Opera, that is
so you won't pop up another annoying pop up in someones face. Cruising
the Opera forums, newsgroups, KB and bug reports will tell you for
sure.
unfortunately, I can't find any mention of this anywhere. I'm still
looking...
I think the correct behavior should be, if my script created the window,
then my script should be able to check if it's closed, regardless of what is
being displayed in it at the time.

Mozilla used to have this same bug, and they fixed it to let .closed be
visible to any code, regardless of security.
From a users point of view, Opera is pretty good, and definitely
a good alternative to the crap microsoft puts out.


It's all a metter of personal preferences. I've disliked every version of
Opera I've tried, and I've liked IE since version 5. I've been testing and
using browsers since mosaic came out, and I think IE6 is the best of any one
I've seen :)

Matt

Jul 20 '05 #3
On Sun, 07 Sep 2003 23:36:03 +0000, Matt Kruse wrote:
"andy johnson" <an************ @chicagonet.net > wrote:
From what I understand about the design philosophy of Opera, that is so
you won't pop up another annoying pop up in someones face. Cruising the
Opera forums, newsgroups, KB and bug reports will tell you for sure.


unfortunately, I can't find any mention of this anywhere. I'm still
looking...
I think the correct behavior should be, if my script created the window,
then my script should be able to check if it's closed, regardless of
what is being displayed in it at the time.

Mozilla used to have this same bug, and they fixed it to let .closed be
visible to any code, regardless of security.
From a users point of view, Opera is pretty good, and definitely a good
alternative to the crap microsoft puts out.


It's all a metter of personal preferences. I've disliked every version
of Opera I've tried, and I've liked IE since version 5. I've been
testing and using browsers since mosaic came out, and I think IE6 is the
best of any one I've seen :)

Matt


Hi Matt

I am no expert here, just learning the language but remember an exercise I
did in my book on this subject. Here is the full code of the exercise, it
creates a window then takes care of all browsers and how to check if the
window has been closed by either the code or the user, if the window has
been closed it will open the same window then close it again, then there
are no errors. Take a look it might help, you might be able to adapt some
of it to your advantage.

Hope it helps
DaveG
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <HTML>
<HEAD>
<TITLE>window.c losed Property</TITLE> <SCRIPT LANGUAGE="JavaS cript">
// initialise global var for new window object // so it can be accessed
by all funtions on the page. var newWind

// set flag to help out with special handling for window closing var
isIE3 = (navigator.appV ersion.indexOf( "MSIE 3") != -1) ? true : false

// make new window and put some stuff in it. function newWindow() {
var output = ""
newWind = window.open("", "subwindow" , "HEIGHT=200 , WIDTH=200")

// taking care of navigator 2
if (newWind.opener == null) {
newWind.openern = window
}
}
output += "<HTML><BODY><H 1>A sub-window</H1>" output += "<FORM><INP UT
TYPE='button' VALUE='Close Main Window'
onClick='window .opener.close() '></FORM></BODY></HTML>"
newWind.documen t.write(output)
newWind.documen t.close()
}
// close subwindow, including ugly workaround for IE3 function
closeWindow() {
if (isIE3) {
// if window is already open, nothing appears to happen // but if not,
the subwndow flashes momentarily (ahhh) newWind = window.open("",
"subwindow" , "HEIGHT=200 , WIDTH=200")
}
if (newWind && !newWind.closed ) {
newWind.close()
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="button" VALUE="Open Window" onClick="newWin dow()"><BR>
<INPUT TYPE="button" VALUE="Close it if still open"
onClick="closeW indow()">
</FORM>
</BODY>
</HTML>
Jul 20 '05 #4
"Dave Griffiths" <da**@daveg.co. uk> wrote:
I am no expert here, just learning the language but remember an exercise I
did in my book on this subject. Here is the full code of the exercise
...
if (newWind && !newWind.closed ) {
newWind.close()
}


This is basically exactly what I'm doing, and what fails in Opera7, when the
domain of the popped up window is not the same as the opener.
:(

Matt Kruse
Jul 20 '05 #5
"Matt Kruse" <ne********@mat tkruse.com> wrote in message
news:6I97b.3946 29$YN5.261425@s ccrnsc01...
<snip>
This is basically exactly what I'm doing, and what fails in Opera7, whenthe domain of the popped up window is not the same as the opener.


In theory, one horrible hackish quick fix would be to have the pop-up
load a frameset page form your domain and then have that frameset load
the page from the other domain. That should leave the new window object
accessible to your scripts.

Given the choice I would go for loosing the pop-up in preference.

Richard.
Jul 20 '05 #6

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

Similar topics

6
2726
by: Shaun Fleming | last post by:
I've been trying to make this simple script compatible across various browsers. It works for IE 6.0 and NS 7 but doesnt work with Opera (I have version 7.11). This is what is supposed to happen: when the user clicks a button in the main window, a dialog window pops up. In the dialog the user enters a university to search for. When the string is submitted, the dialog then shows all the matches found in the database. The user picks one and...
44
3897
by: Mariusz Jedrzejewski | last post by:
Hi, I'll be very grateful if somebody can explain me why my Opera 7.23 (runing under linux) doesn't show me inner tables. Using below code I can see only "inner table 1". There is no problem with other browsers (I checked it under Konqueror). Thank you in advance for your help. Regards. /Mariusz <HTML>
32
2515
by: Eli | last post by:
How can I POST a form into a new window where I control the size and other attributes of the new window? Also. Are there any implications, perhaps due to browser security (Interne Explorer?) that could cause problems if I try to post a form at www.mydomain.com to www.anotherdomain.com?
7
3228
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 8. Jspw3 opens a popup window (using varname=window.open(...)) but there are now two problems: 1) Opera8 interprets a top,left of 0,0 to be top left of the browser window rather than of the entire screen, unlike the other modern browsers I've...
0
18459
by: BGS | last post by:
I have a web site (www.on-the-matrix.com) that displays photos in a "slide show" format on ASPX pages that run in an inline frame on an ASP page (or in a separate pop-up window). The ASPX pages use a hidden form to transmit information back to the server so it will know which is the next photo to load. All of this works as intended in modern versions of Internet Explorer, Netscape and Mozilla. With Opera, however, users receive a...
21
18176
by: alistair_henderson | last post by:
Morning All, I have some code for a website which uses 'window.open' to simulate modal dialog boxes. I use the window.closed property to decide if the window object exists at various points. This has been fine until last week when I started getting javascript 'Permission Denied' errors when I try to access this property. I suspect that a windows update has caused this somehow, as this code has not changed for a very long time. Can...
6
1851
by: toffee | last post by:
Hi all, i have several php files which each run a different SELECT query and displays the data in a table. I would like to create an option to export the table to excel and one route i would like to go down is creating a single export.php file with an excel header; and basically it would read the sql query stored in a session; and just create a spreadsheet from the results. the problem is each query yields a different number of columns,...
2
1960
by: koruyucu | last post by:
we'd like to make smth like google implemented in gmail: when user compose mail and then wants to leave page without actually sending it, gmail notifies user about mail was not sent. this should happens when user clicks link or press browser back button. So the problem is that Opera does not support "beforeunload" event and thus it is not possible to inform user that hes about to lose his work. is there a way another then adding scripts to...
0
9592
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10004
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.