473,473 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Why parentNode has no properties?

RC
I have a simple test page with frames

<html><title>Title A</title>

<frameset rows="50%,*">
<frame src="frame1.html" name="frame1" />
<frame src="frames.html" name="frame2" />
</frameset>
</html>

In frame1.html I want to get the parent's title and
change it

function changeTitle(newTitle) {

var upperNode = document.parentNode;
var upperTitle = upperNode.title;
alert(upperTitle);
upperNode.title = newTitle;
}
The problem is 2nd line, error message says
upperNode has no properties.

But I check the DOM console in Firefox, it has properties, include the
title.

Please help how to change the Web browser's title?
Thank Q very much!
May 31 '07 #1
1 2054
RC wrote:
var upperNode = document.parentNode;
The document node is the root of the DOM tree so it does not have a
parent node. If you are scripting a frame and you are looking for the
_parent window_ then use e.g.
window.parent
to access the parent window and then e.g.
window.parent.document.title
to access the title of the document in the parent window (for instance
the title of the frameset document).

--

Martin Honnen
http://JavaScript.FAQTs.com/
May 31 '07 #2

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

Similar topics

1
by: yawnmoth | last post by:
Given an element ID, is there a way to figure out what index one would need to use in the parentNode's childNodes array to get at that element? For example... <body> <div id="parent"> <div...
2
by: DanielLinn | last post by:
I'm getting an error in IE 6.0.2800 that says "Error: Not implemented." when I try to get a parent. Does it whether or not 'compatibility mode' is on. Here's my code: <!DOCTYPE html PUBLIC...
2
by: amattie | last post by:
Anyone know what the specific difference is between the offsetParent and parentNode properties of a DOM element are? Mozilla's docs on the DOM element...
1
by: RC | last post by:
I have a simple test page with frames <html><title>Title A</title> <frameset rows="50%,*"> <frame src="frame1.html" name="frame1" /> <frame src="frames.html" name="frame2" /> </frameset>...
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
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...
1
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...
0
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...
0
agi2029
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,...
1
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...
0
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...
0
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 ...
1
muto222
php
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.