[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

referencing a frame element within a frameset within an iframe

Posted on 2004-11-02
3
Medium Priority
?
276 Views
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.
0
Comment
Question by:tigress298
  • 2
3 Comments
 
LVL 2

Expert Comment

by:siliconeagle
ID: 12484031
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');
0
 

Author Comment

by:tigress298
ID: 12487053
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.
0
 
LVL 2

Accepted Solution

by:
siliconeagle earned 2000 total points
ID: 12487251
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">

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

834 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