It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

frameElement question

frameElement question

Postby deluxmilkman on Wed Oct 03, 2007 2:16 pm

i have this on my main html.
[HTML]
<head></head>
<frameset rows="110,*" cols="*" framespacing="0" frameborder="no" border="0" bordercolor="#FFFFFF">
<frame src="top.html" name="top" frameborder="no" scrolling="no" id="top">
<frame src="bottom1.html" name="bottom" id="bottom">
<noframes><body>

</body></noframes>

[/HTML]

and i would like to change the "bottom frame src" using something like this.

[HTML]

function bottomChange(){
var oFrame = window.frameElement;
oFrame.src = "bottom2.html";
}

[/HTML]

now if im writing this function on "top.html" what "window.frameElement" section should be?
deluxmilkman
 
Posts: 8
Joined: Wed Sep 26, 2007 3:15 pm

Postby bobbyblades on Thu Oct 04, 2007 2:31 am

so your trying to access a frame? you can go to the window object's frames array like:

by frame index: window.frames[index].src
by frame name: window.frames.framename.src

oh and remember to give the frame a name: name="whatever"
User avatar
bobbyblades
50+ Club
 
Posts: 85
Joined: Fri Aug 24, 2007 8:38 pm
Location: hawaii or bust


Who is online

Users browsing this forum: No registered users and 5 guests