Link to home
Start Free TrialLog in
Avatar of tigress298
tigress298

asked on

referencing a frame element within a frameset within an iframe

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.
Avatar of siliconeagle
siliconeagle

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.

e.g
var presistenceDoc=top.frames['name'].frames['presistence'];
access js variables in your presistence document with:-
presistenceDoc.jsVariable;
and functions
presistenceDoc.jsFunction();
access HTML elements in your presistence document with:-
presistenceDoc.getElementById('htmlElementId');
Avatar of tigress298

ASKER

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.
</IFRAME>


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
ID?
I guess I just don't know if IFrames work the same way as frameset for referencing purposes.
ASKER CERTIFIED SOLUTION
Avatar of siliconeagle
siliconeagle

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial