473,386 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Dynamically add frames to frameset

Yun
I have a frameset initially loaded to a page
<frameset id=SV name=SV></frameset>

Now I want to use JavaScript to dynamically add frames to this
frameset. I have tried to use code like "document.frames.SV.innerHTML
= framedefinition"
Nothing worked.

How do I achieve this goal with JavaScript?

Thanks.
Nov 7 '08 #1
5 9235
Yun <yu******@gmail.comwrote in news:9d02177b-868a-4484-819d-a2d49f2d2370
@d42g2000prb.googlegroups.com:
I have a frameset initially loaded to a page
<frameset id=SV name=SV></frameset>

Now I want to use JavaScript to dynamically add frames to this
frameset. I have tried to use code like "document.frames.SV.innerHTML
= framedefinition"
Nothing worked.

How do I achieve this goal with JavaScript?

Thanks.
http://www.quirksmode.org/js/frameintro.html
Nov 7 '08 #2
Yun
Your answer is NOT an answer to my question. It merely explained how
to access frames and their elements from JavaScrpt.
What I am looking for is to CREATE new frames in a empty frameset with
JavaScript functions.

On Nov 7, 2:43*pm, Good Man <he...@letsgo.comwrote:
Yun <yun.w...@gmail.comwrote in news:9d02177b-868a-4484-819d-a2d49f2d2370
@d42g2000prb.googlegroups.com:
I have a frameset initially loaded to a page
<frameset id=SV name=SV></frameset>
Now I want to use JavaScript to dynamically add frames to this
frameset. *I have tried to use code like "document.frames.SV.innerHTML
= framedefinition"
Nothing worked.
How do I achieve this goal with JavaScript?
Thanks.

http://www.quirksmode.org/js/frameintro.html
Nov 7 '08 #3
Yun <yu******@gmail.comwrote in
news:7b**********************************@d36g2000 prf.googlegroups.com:
Your answer is NOT an answer to my question. It merely explained how
to access frames and their elements from JavaScrpt.
What I am looking for is to CREATE new frames in a empty frameset with
JavaScript functions.
learn about the DOM. innerHTML is not the way to go.

you'll need to brush up on JS anyways, just trying random stuff like
"document.frames.SV" isn't going to get you anywhere. of course, if you
DID read that link, you'd know how to properly access your frame named SV.
Nov 7 '08 #4
Yun
It sounds like you are really good with DOM and frames. I have tried
to use createElement and then append. It works for DOM element in one
page and across frames. But it doesn't work for FRAME or FRAMESET
itself.
Would you like to provide a sample code to dynamically append new
frame to an existing frameset?
On Nov 7, 2:56*pm, Good Man <he...@letsgo.comwrote:
Yun <yun.w...@gmail.comwrote innews:7b**********************************@d36g20 00prf.googlegroups.com:
Your answer is NOT an answer to my question. It merely explained how
to access frames and their elements from JavaScrpt.
What I am looking for is to CREATE new frames in a empty frameset with
JavaScript functions.

learn about the DOM. *innerHTML is not the way to go.

you'll need to brush up on JS anyways, just trying random stuff like
"document.frames.SV" isn't going to get you anywhere. *of course, if you
DID read that link, you'd know how to properly access your frame named SV..
Nov 7 '08 #5
On Nov 7, 9:51*pm, Yun <yun.w...@gmail.comwrote:
It sounds like you are really good with DOM and frames. I have tried
to use createElement and then append. It works for DOM element in one
page and across frames. But it doesn't work for FRAME or FRAMESET
itself.
Would you like to provide a sample code to dynamically append new
frame to an existing frameset?

On Nov 7, 2:56*pm, Good Man <he...@letsgo.comwrote:
Yun <yun.w...@gmail.comwrote innews:7b**********************************@d36g20 00prf.googlegroups.com:
Your answer is NOT an answer to my question. It merely explained how
to access frames and their elements from JavaScrpt.
What I am looking for is to CREATE new frames in a empty frameset with
JavaScript functions.
learn about the DOM. *innerHTML is not the way to go.
you'll need to brush up on JS anyways, just trying random stuff like
"document.frames.SV" isn't going to get you anywhere. *of course, if you
DID read that link, you'd know how to properly access your frame named SV.
Of course!

function makeNewFrame(parentFrameId,newFrameId,targetUri) {
var newFrame = document.createElement("frame");
newFrame.id = newFrameId;
newFrame.name = newFrameId;
newFrame.src = targetUri;

var frameset = document.getElementById(parentFrameId);

frameset.appendChild(newFrame);
}

I am also remembering that you must bear in mind that a frameset
generally has a rows and cols property, which defines the initial
distribution. If you are adding new frames, you will need to amend
these, otherwise no space will be allocated to the new frame and thus
it won't be visible.

You can access these like so:

frameset.rows = "80, *, *"; // etc..etc..

Same for the cols property. Which you can set to null if you just
want these frames to appear one above the other.

Stefan
Nov 7 '08 #6

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

Similar topics

1
by: JP | last post by:
Hi, How can I create a dynamic frameset whose content changes based on user inputs? Specifically, how do I toggle a frame within a frameset? How can I allow a user to "close" or "dock" a...
0
by: Mike | last post by:
I have a frameset that was working fine then suddenly a link that is suppose to load a page in an adjeacent frame opens a new window instead. What could be causing this? Problem prevalent in IE...
6
by: Wladimir Borsov | last post by:
I would like to load multiple web pages from Internet into ONE single browser window - one below the other. How do I do that most easily ? One idea is to built a frameset (for e.g 6 web pages)...
5
by: Ivo | last post by:
Dear Newsgroup, many framed sites have an ancient script in all their pages: if(top==self) top.location=theframeset Some friendlier ones do this: if(top==self) document.write( '<a...
7
by: David Hayes | last post by:
I tried finding an answer on http://www.quirksmode.org/ without success. I am attempting a complicated Frames structure. I have made it work in IE, but not Netscape. I begin with three...
2
by: semantiks | last post by:
Been at this for 3 days. Have no hair left. It's gotta be simple. Can anyone help? I have a frameset with four frames: <frameset cols="150,*"> <frame name="top" src="gallery1a.htm">...
2
by: pete K | last post by:
I'm sure this is something simple that I'm missing, but here's my problem. I have two frames. <frameset> <frame name="rtop" src="something1.aspx"> <frame name="rbottom" src="something2.aspx">...
14
by: Mark | last post by:
Hi Guys, I am very new to ASP.NET world. I need to create three frames. One at the top, one on the left and another on the right side. I don't know how to do it. So please help me with it. ...
12
by: Geoff Cox | last post by:
Hello I'm having a problem loading a frameset file using an include in a php file. Nothing is displayed and when I look at the source code I see that <html> <head> <title></title>
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
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...

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.