Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

plz explain this line of code

Status
Not open for further replies.

estesflyer

Programmer
Dec 19, 2000
284
US
<a href=&quot;#&quot;
onClick=&quot;top.target_frame.document.writeln('Monkey do!<br>');&quot;>Monkey see</a>

i got this from the webmonkey.com tutorials. its supposed to be a frameset, where you have to frame windows, a top and a bottom. the top frame has a link, that says, monkey see. when you click on the link, it writes text to the bottom window, that says, monkey do. what is w/ the top thing? it says, top.target_frame.document.writeIn. I wanna know what the &quot;top&quot; is doing, and if there is a left, right,bottom, down, etc...

thx,
- Rusty
 
top translates to the frameset document at the top of the heirarchy. In this case it's equivalent to saying parent.whatever jared@aauser.com
 
ok, so what if you had 8 rows, and 8 columns of framesets? what would be the 6th one over, and the 3rd one down? you wouldnt put left I dont think.
 
no, top is a special property.

the other frames you reference by name:

top.mynavigationframe.something
top.contentarea.something
top.bannerspace.something

you name them in frameset document jared@aauser.com
 
depending upon how you had created them, it would be


top.frames[num].frames[num] adam@aauser.com
 
ok, so top is the only special command? there isnt any bottom, or left, or whatever?
if you had the 6th one over, and the 3rd one down, you would put something like this?
windowname.eightthree.document.write(); ?
 
argh. what i mean to say, is that, is there any other special properties, besides top. like, you wouldnt call the bottom frame, top.bottomframe.document.write(); would you?
 
if the bottom frame was named bottomframe, you could. adam@aauser.com
 
im asking what other special properties there are besides top. :)
 
for frames? that might be the only one... jared@aauser.com
 
ok, so what if instead of having
<a href=&quot;#&quot;
onClick=&quot;top.target_frame.document.writeln('Monkey do!<br>');&quot;>Monkey see</a>

in the top frame, and having the bottom frame blank, have it in the bottom frame, and have the top frame blank.
so when the user clicks the link &quot;Monkey see&quot;, monkey do appears in the top frame. I tried it w/ using (i rewrote the names of the frame windows)
top.top_frame.document.write('Monkey Do'); but it ended up having the top frame blank, and the bottom frame had monkey do printed inside it. how could I get this to work?
 
put a link to your code here (or just put all of it here), and maybe I'll be able to help you... jared@aauser.com
 
&quot;parent&quot; and &quot;top&quot; are the only special window variables regarding frames that I know of. Anything else you should reference by either its name (given at the time of definition) or by the frames[] array.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top