How Do I Make Sure My Framed Documents Are Displayed Inside Their Frameset

How Do I Make Sure My Framed Documents Are Displayed Inside Their Frameset


  • 8 Mar, 2012

    When the sub-documents of a frameset state are accessed directly, they appear without the context of the surrounding frameset.If the reader's browser has JavaScript support enabled, the following script will restore the frameset:<SCRIPT TYPE="text/javascript">if (parent.location.href == self.location.href) {if (window.location.href.replace)window.location.replace('frameset.html');else// causes problems with back button, but workswindow.location.href = 'frameset.html';}</SCRIPT>A more universal approach is a "restore frames" link:<A HREF="frameset.html" TARGET="_top">Restore FramesNote that in either case, you must have a separate frameset document for every content document. If you link to the default frameset document, then your reader will get the default content document, rather than the content document he/she was trying to access. These frameset documents should be generated automatically, to avoid the tedium and inaccuracy of creating them by hand.Note that you can work around the problem with bookmarking frameset states by linking to these separate frameset documents using TARGET="_top", rather than linking to the individual content documents.

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.