By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,826 Members | 2,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,826 IT Pros & Developers. It's quick & easy.

Cloning entire page to hidden frame

P: n/a
Is it possible using javascript to copy the entire contents of a frame,
at code level, to a hidden frame or even variable or container, so you
can spit it out again instantly to a frame in the future?

I am helping to develop a web application that uses three different
frames, but there is quite a bit of changing of frame sources.
Needless to say, when a frame has its location changes, the "old"
contents are lost. I want to keep them somewhere.

Then, when a user needs to "revisit" the old frame, I want to dump its
contents back to any of three other frames. This will maintain state,
and make for quick "refreshes".

Is this possible?

Ann

Feb 1 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Giggle Girl wrote:
Is it possible using javascript to copy the entire contents of a frame,
at code level, to a hidden frame or even variable or container, so you
can spit it out again instantly to a frame in the future?
Why not just set its CSS display property to hidden and have the new
frame display its place? To re-display it, set its display property to
'' (empty string).


I am helping to develop a web application that uses three different
frames, but there is quite a bit of changing of frame sources.
Needless to say, when a frame has its location changes, the "old"
contents are lost. I want to keep them somewhere.

Then, when a user needs to "revisit" the old frame, I want to dump its
contents back to any of three other frames. This will maintain state,
and make for quick "refreshes".


You can clone the entire frame, but then you run the risk of creating
multiple instances of the same element ID. Presumably you will clone
the content then delete the original - the above hide/show method
achieves that with simplicity.
--
Rob
Feb 1 '06 #2

P: n/a
Hmmm Rob,
I am thinking about what you are saying. Does it work like this:

In a specific frame, have each possible "page" contained in a div tag,
and set all of them to visibility: hidden except the one being used?
Is this right?

If not, please explain what you mean. :)

If it is right, there will be some issues, because the application I am
helping to build does a lot of serverside stuff, and currently passes
many values using a location = "_page_to_display?vals=lotsofstuff" when
a new page is to be displayed. Having to redo this method may take too
much devleopment time and possibly goes beyond my jurisdiction.

Any more thoughts on this?

Thanks so much,
Ann

Feb 2 '06 #3

P: n/a
Giggle Girl wrote:
Hmmm Rob,
I am thinking about what you are saying. Does it work like this:

In a specific frame, have each possible "page" contained in a div tag,
and set all of them to visibility: hidden except the one being used?
Is this right?
If you use visibility:hidden, elements still take up room on the page as
if they were still visible. display:none completely removes them from
the flow. Setting display to '' (empty string) puts them back in so
they are visible and take up space again.

If not, please explain what you mean. :)

If it is right, there will be some issues, because the application I am
helping to build does a lot of serverside stuff, and currently passes
many values using a location = "_page_to_display?vals=lotsofstuff" when
a new page is to be displayed. Having to redo this method may take too
much devleopment time and possibly goes beyond my jurisdiction.

Any more thoughts on this?
What do you do with the 'lots of stuff'? Your original question was
about removing an element and its content from the page, then putting it
back later. Using the display property is one way, another is to
actually remove the element from the page.

Document fragments can be removed and stored by keeping a reference to
them or by creating a document fragment and attaching them to that - see
this thread:

<URL:
http://groups.google.co.uk/group/com...ce856ff314f102


--
Rob
Feb 3 '06 #4

P: n/a
Thank you so much for your time and the link, RobG.

Ann

Feb 3 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.