Re: Changing the "SRC&qu ot; attribute of a frame
"Charles Crume" <cc@charlescrum esoftware.com> writes:
[color=blue]
> However, and perhaps I have not articulated my difficulty in understanding
> this adequately, but I do not see any info on the "location.h ref" property
> that you used in:
>
> top.logo.locati on.href='images/ccs_logo.gif';[/color]
I would recommend using
top.frames['logo'].location.href = ...
or
top.frames.logo .location.href = ...
to access the frame through the appropriate collection.
The location property is a property of window objects. A frame is
implemented as a window, so it has all the properties.
You can read more about the location object here:
<URL:http://devedge.netscap e.com/library/manuals/2000/javascript/1.3/reference/location.html>
[color=blue]
> Where does "location" come from?[/color]
It is a property of window objects.
[color=blue]
> Where does "href" come from?[/color]
It is a property of Location objects.
[color=blue]
> This site, as well as all the others I've looked at, show the "SRC"
> attribute (property??) to be what holds the URL.[/color]
The src property is a property of Frame DOM elements.
Your HTML page is parsed from text into an internal represntation
called the Document Object Model (DOM), where the document is
structured as a tree. Each HTML element (from start tag to end tag)
generates one Element node in the DOM tree, and has as children (or
children's children etc) all elements that occour between the start
and end tag. This places your Frame element somewhere in the DOM
tree as an instance of HTMLFrameElemen t. That element has a "src"
property.
The browser also has one object corresponding to each view of a
document, either a separate window or a frame. Those are Window
objects, and are typically also used as the global object for
Javascript execution (the global object is where the global variables
live).
[color=blue]
> Am I missing something *real* obvious here?[/color]
A lot of reading :)
I have some links on DOM and DHTML here:
<URL:http://www.infimum.dk/HTML/references.html #ref_1_4>
The refrences I use the most are the DOM 2 Core and HTML
specifications, the ECMAScript v3 standard, and the Gecko and IE DOM
references, but that is for reference, not learning. They could be
pretty hard on a beginner :)
/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
"Charles Crume" <cc@charlescrum esoftware.com> writes:
[color=blue]
> However, and perhaps I have not articulated my difficulty in understanding
> this adequately, but I do not see any info on the "location.h ref" property
> that you used in:
>
> top.logo.locati on.href='images/ccs_logo.gif';[/color]
I would recommend using
top.frames['logo'].location.href = ...
or
top.frames.logo .location.href = ...
to access the frame through the appropriate collection.
The location property is a property of window objects. A frame is
implemented as a window, so it has all the properties.
You can read more about the location object here:
<URL:http://devedge.netscap e.com/library/manuals/2000/javascript/1.3/reference/location.html>
[color=blue]
> Where does "location" come from?[/color]
It is a property of window objects.
[color=blue]
> Where does "href" come from?[/color]
It is a property of Location objects.
[color=blue]
> This site, as well as all the others I've looked at, show the "SRC"
> attribute (property??) to be what holds the URL.[/color]
The src property is a property of Frame DOM elements.
Your HTML page is parsed from text into an internal represntation
called the Document Object Model (DOM), where the document is
structured as a tree. Each HTML element (from start tag to end tag)
generates one Element node in the DOM tree, and has as children (or
children's children etc) all elements that occour between the start
and end tag. This places your Frame element somewhere in the DOM
tree as an instance of HTMLFrameElemen t. That element has a "src"
property.
The browser also has one object corresponding to each view of a
document, either a separate window or a frame. Those are Window
objects, and are typically also used as the global object for
Javascript execution (the global object is where the global variables
live).
[color=blue]
> Am I missing something *real* obvious here?[/color]
A lot of reading :)
I have some links on DOM and DHTML here:
<URL:http://www.infimum.dk/HTML/references.html #ref_1_4>
The refrences I use the most are the DOM 2 Core and HTML
specifications, the ECMAScript v3 standard, and the Gecko and IE DOM
references, but that is for reference, not learning. They could be
pretty hard on a beginner :)
/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Comment