I am going to take a wild guess in the dark and question if its
possible that your script is running not only on the main frameset,
but also within a frame (or each frame)?  It seems unlikely that it
would even work at that point but it is possible that if any of your
pages also have a frameset in them, in which case you might see a
duplicate.

as for:  var original = frmst[0].lastChild; //assuming my frameset is
the first one

I think you should be using cloneNode in this instance, if you remove
it from the tree later, I've never tried adding an element to the tree
that was already added to the tree, although maybe thats a nice
shortcut, you wouldn't have to remove it if you appended it elsewhere,
however I'm not certain it works that way or what it does exactly.

Yeah it all makes sense, since you will also have to clone it before
you subframe.appendChild(sidepanel);, at which time frmst[0].lastChild
== sidepanel

On Jul 27, 5:39 pm, UncleDan <[email protected]> wrote:
> Problem: in a given frameset I need to "change" a row-frame with a
> nested frameset so that I can use the extra width for a widescreen.
>
> ORIGINAL FRAMESET:
> <frameset rows="100,50,*">
> <frame src="row01.html" name="row01">
> <frame src="row02.html" name="row02">
> <frame src="row03.html" name="row03">
> </frameset>
>
> DESIRED FRAMESET:
> <frameset rows="100,50,*">
> <frame src="row01.html">
> <frame src="row02.html">
> <frameset cols="*,900">
> <frame src="row03side.html">
> <frame src="row03.html">
> </frameset>
> </frameset>
>
> MY CODE:
> var frmst = document.getElementsByTagName('frameset');
> var subframe = document.createElement("frameset");
> subframe.cols = "*,900";
> var sidepanel = document.createElement("frame");
> sidepanel.setAttribute("src","row03side.html");
> sidepanel.setAttribute("name","row03side");
> subframe.appendChild(sidepanel);
> var original = frmst[0].lastChild; //assuming my frameset is the first
> one
> subframe.appendChild(original);
> frmst[0].removeChild(frmst[0].lastChild);
> frmst[0].appendChild(subframe);
>
> NOTES:
> 1) if I only append subframe without removing lastchild everything
> seems to work fine (except I see a double row03 frame!!)
> 2) I'm a total newbie in js!!
>
> Any hint appreciated.
>
> Thanks,
>                       UD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to