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