referencing a frame element within a frameset within an iframe

Posted on 2004-11-02
Last Modified: 2013-11-19
I have a web app I am updating to scroll when the window is smaller than 1024x768.  I currently have the index.html page referencing a login.jsp page which in turn, currently loads the index.jsp page which contains a frame set consising of 2 rows.  The first has 3 frames, a hidden persistance frame which references all the persistent variables contained in persistence.jsp, a hidden communications frame, and the headline.  The second row references the content.jsp page which contains a frameset with 2 columns (leftHandMenu and Viewer).

I am adding the iframe layer in such a way as to encapsulate the index.jsp page so that when the windo is resized or too small, it will be scrollable.  The new DOM looks like index.html-->login.jsp-->iframe.jsp-->index.jsp.  The problem is that since I'm adding a new top layer, the references to the persistence.jsp values are no longer valid.  How would I go about fixing those references with the new layer added, and is there a better way for me to accomplish my goal?  Thanks.
Question by:tigress298
    LVL 2

    Expert Comment

    you will probably have to just do a search/replace on whatever the perfix was to your persistence.jsp document. while doing so you could make a variable so if you have to do the same thing again or just generally re-organize your frames in the future than you will only have to cahnge one line.

    var presistenceDoc=top.frames['name'].frames['presistence'];
    access js variables in your presistence document with:-
    and functions
    access HTML elements in your presistence document with:-

    Author Comment

    in iframe.jsp:

    <IFRAME SRC="index.jsp" WIDTH=1024 HEIGHT=768 frameborder=1>
    If you can see this, your browser doesn't
    understand IFRAME.  However, we'll still
    <A HREF="index.jsp">link</A>
    you to the file.

    how would I reference the index.jsp's frames from this iFrame?
    top.frames["index"].frames["persistence"]?  or some other way?  Do I need to give it an
    I guess I just don't know if IFrames work the same way as frameset for referencing purposes.
    LVL 2

    Accepted Solution

    yes, they do the same as normal frames. you need to set the name and id for you code above to work however. <IFRAME SRC="index.jsp" WIDTH=1024 HEIGHT=768 frameborder=1 name="index" id="index">


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    website file permissions 4 43
    PHP parse error 7 41
    selectSingleNode in Access 2013 11 37
    Books that can get me started on JAVA 2 34
    Preface In the first article: A Better Website Login System ( I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
    JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now