In Firefox if an HTML page is not hosted inside a frame or iframe, the
following return true:
(window === window.self);
(window === window.parent);
But in IE they return false (using == returns true for both). Can
someone explain why?
Saying "It's DOM 0 so anything goes" is a cop-out. :-)
A test:
function testSelf()
{
alert('window === window.self: ' + (window === window.self)
+ '\n'
+ 'window === window.parent: ' + (window === window.parent)
);
}
window.onload = testSelf;
And in a related incident... testThing() returns true in both browsers:
function Thing(){
this.mySelf = this;
}
function testThing()
{
var x = new Thing();
return x.mySelf === x;
}
alert(testThing ());
--
Rob 3 2723
RobG wrote:
"In Firefox if an HTML page is not hosted inside a frame or iframe, the
following return true:
******(window === window.self);
***(window === window.parent);
But in IE they return false (using == returns true for both). Can
someone explain why?
Saying "It's DOM 0 so anything goes" is a cop-out. :-)
A test:
******function testSelf()
******{
**********alert ('window === window.self: ' + (window
=== window.self)
*************** ***+ '\n'
*************** ***+ 'window ===
window.parent: ' + (window === window.parent)
;
******}
******window.on load = testSelf;"
For what it's worth, this is the result with WebTV:
window === window.self: true
window === window.parent: true
We are at the level of IE4, not completely though. As a matter of fact,
barely IE4.
With regards to the results you're getting at your end, and taking into
consideration my very basic understanding of the difference between ==
and ===, it's as if IE is saying it's sort of true but not exactly.
Which doesn't make sense to me.
Later, Art.
X l e c t r i c wrote:
[...] For what it's worth, this is the result with WebTV:
window === window.self: true window === window.parent: true
We are at the level of IE4, not completely though. As a matter of fact, barely IE4.
That's sad!
With regards to the results you're getting at your end, and taking into consideration my very basic understanding of the difference between == and ===, it's as if IE is saying it's sort of true but not exactly. Which doesn't make sense to me.
Exactly. It says to me that they refer to the same object (==), but
somehow that object is not identically equivalent (===) to itself.
I thought maybe it was because the reference is different, but in then
testThing() should also give false.
--
Rob
RobG wrote:
"Exactly. It says to me that they refer to the same object (==), but
somehow that object is not identically equivalent (===) to itself.
I thought maybe it was because the reference is different, but in then
testThing() should also give false."
Even though parent and self are a reference to the window, I wondered if
Explorer might be seeing window.parent and window.self as object object.
But when I did a typeof check for window, window.parent, window.self,
parent, and self, they all were object on both Explorer and Firefox.
Yes, it was a waste of time checking the obvious, but now I no longer
wonder. About that.
Later, Art. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Lee |
last post by:
I am using a modal window and an iFrame to try and pull a return value
back. I am doing this across domains.
I have the value returned from the modal window to the iFrame window
but I can not get the value returned to the parent window. The alert
in the parent window always returns undefined errors. Any help would
be much appreciated.
...
|
by: Filiz Duman |
last post by:
Is it possible to call a javascript function based in the parent window from
the child window ?
I do open a pop up window from the parent window with:
newwindow = window.open (...)
and assign a value from the child window to the parent window text field:
opener.document.forms.elements.value = valuename;
|
by: Hal |
last post by:
Can someone please tell me what is wrong with this script?
<script language="JavaScript">
<!--
function HF_CloseAllChildren() {
if (g_win1) != undefined {
if ((g_win1) && !(g_win1.closed))
g_win1.close();
}
}
|
by: Robert Nurse |
last post by:
Hi All,
I'm trying to alter the contents of a drop-down (select) list on the
parent window from a child window in IE 6. After opening the child
window, I set its opener to reference the parent like this:
childwin = window.open(...)
if (childwin == null)
childwin.opener = self;
|
by: Paul |
last post by:
HI! I have a script that does not seem to work. can someone tell me what I
am doing wrong here?
<script language="JavaScript">
function firefoxautofix(){
parent.window.resizeBy(-1,-1)
parent.window.resizeBy(+1,+1)
}
</script>
| |
by: Raj |
last post by:
Hi All,
I have a problem with trying to refresh the parent window from
child window in order to update data in the parent window.
The sequence of events are
1) I click a button in the parent window to open a child window thru
javascript
window.open
2) I have some functionality in the child window that changes the data
|
by: Earl Teigrob |
last post by:
I am thinking about using a popup window to edit settings that will affect
parent asp.net page. The data that is changed in the popup window will be
saved to the datastore that is loaded and displayed by the parent page. In
order to refresh the parent page, I would like to raise an event in the
popup (child) page that is subscribed to by the...
|
by: Earl Teigrob |
last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at
http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx
but it was far more complex then I needed. (I got lost trying to figure it all...
|
by: epaetz |
last post by:
Is there a way to decouple the linkage between a parent and a child
window?
Does the parent window have any sort of a collection that holds all the
children that it has spawned?
I want to break that connection from the parent side or the child
side, it doesn't matter as long as the communication link is completely
broken. I don't want...
|
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. ...
|
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...
| |
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |