473,715 Members | 2,192 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 4416
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
2725
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
3879
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
2505
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
3225
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
18171
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
1848
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
1958
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
9322
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9193
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
9092
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
9037
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...
1
6641
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5964
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
4734
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3170
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
3
2116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.