Solved

Compund frames/ changing targets??

Posted on 1998-09-21
26
234 Views
Last Modified: 2010-04-09
I have a simple frames page:
|------------------
| C |              |
| o |              |
| n |  Main        |

Where "con" is a contents menu with target linked to main.
Ok every is fine but what if I want to have any link from "con" open a new frameset within main which is composed of a header and a "main" and then have every link thereafter from "con" target the new main without realoading the header.  Possible??
0
Comment
Question by:guadalupe
  • 12
  • 12
  • +1
26 Comments
 
LVL 1

Expert Comment

by:dagon
ID: 1837984
What not start with header-con-main, rather than load con-main at a latter date.
0
 
LVL 3

Expert Comment

by:zhongbing
ID: 1837985
Yes, it's possible, but i think you need a javascript in the "con" frame instead of use <A href.....>link. If you don't know how to program it use javascript. I can give you help.
0
 
LVL 8

Accepted Solution

by:
jbirk earned 100 total points
ID: 1837986
This shouldn't be too hard with a little javascript, but it's always simpler to go with a frameset which already includes all of your frames.

To use javascript, you would probably either produce the entire frameset by writing to the frame via javascript, or load an html page that uses the location search property (I think IE has problems with this method when it's in frames though).  So each time that the user clicks on the left side, it first checks to see if the right frameset includes a header, if so it just changes the location, something that looks like this:
top.main.sub_main.location="url.html";
If not, it has to generate the code for the frameset.

I can also help with the javascript if you would like it.
-Josh
0
 
LVL 3

Author Comment

by:guadalupe
ID: 1837987
Josh Thanks for the response.  Yes I think the Java script is the way to go.  I'm not sure how the code would be though can you help.  Thanks.
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1837988
I'll try to work on it this sometime this evening.  I have classes and work until then.
-Josh
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1837989
OK, I've written a test page for this, and it works fine in Netscape 3+ and IE 4+.  I haven't tested it in Netscape 2 or IE 3, but if you're concerned about those, you might want to test for them.  I wouldn't be surprised if it doesn't work for them though... (old version of javascript).

Anyway, goto:
http://aegis.mcs.kent.edu/~jbirk/EE/frames/
to see my demo.  You can then save any pages you need (probably just index.html and contents.html) and then use the code I had there.

Best of luck!
-Josh
0
 
LVL 3

Author Comment

by:guadalupe
ID: 1837990
Josh,

Thanks you really came through and quick too!!!!!  I haven't actually adapted the scrit to my page yet as I just visited/saved you sample code/site, but it seems to be perfect and just what I wanted!!!!!!! I think you also responded to my question about passing DHTML positioning coordinates to a perl script it turns out that indeed using hiden fields and a script to re-assign the new top and left to the values of the hidden fields to then be passed along to the perl script is the ticket
if you hav any more input I'd love to hear it but not to worry you've already won my heart.  Thanks Jason/Guadalupe
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1837991
Thanks for your confidence Jason.  As you might be able to tell I love problem solving.  Also, my best friend and I do this kind of problem solving for a corporate sight we're putting up right now that uses a bunch of different web page technologies, and that has really helped my perl/html/javascript interaction as well.

-Josh
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1837992
I'm sorry if my sentences in my previous comments don't make much sence.  I'm operating on very little sleep and am having trouble constructing sentences that make sense (as well as focusing on the screen).
-Josh
0
 
LVL 3

Author Comment

by:guadalupe
ID: 1837993
Hey Josh,

I ran into a little problem.  In NS 4 but not MS (I dont know about 3's) the pages in sub-main are not display scroll bars.  I already tried changing the line which writes the sub-main frame to:
top.main.document.write('<frame name="sub_main" src="'+ addr + '" scrolling="yes">\n' );

and also to "auto" but to no avail.  Any suggestions.  Also thanks again!
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1837994
Interesting problem.  Sometimes browsers have these difficulties with dynamically written framesets.  To be truthfull, I'm not exactly sure what to do here.  I would have tried what you said you tried first as well.
The best method is to probably create the frameset in html, and then load the urls into the frames dynamically.  If you don't know how to do this, and you want me to work on it I can work on this later.

-Josh
0
 
LVL 3

Author Comment

by:guadalupe
ID: 1837995
Hey Josh,

I must admit that I don't understand how this would work as it sounds like I would have to create the frameset with the header right from the start which is what I was trying to avoid. Like last time I would love your help with the script and thanks for all the help!!!!!  Again, before did I have to add a new question or was the comment sufficent?

Thanks Jason!!!!!
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1837996
Normally a comment is sufficient if it's still involved with the same question.  If it's a new question or even a related question it usually needs to be a brand new question.  This is still involved with the same question, so you didn't really need to ask a neq quesiton.  Also if you were wondering whether or not I still got an e-mail notification after it's been accepted, I do continue to get e-mail notifications.

I will post all future comments in the new question you opened.
-Josh
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 3

Author Comment

by:guadalupe
ID: 1837997
Hey Josh, I just your script on netscape 3.0 gold and it runs perfectly.  What the %$&@!, talk about wierd.  You would expect the java support to be worse not better.  I know this is only one instance of a specific example but...  Any chance I have a faulty copy of 4? Can you see if it runs on your Net 4 and by the way any way to setup MS IE 3 on a Win 98 machine it won't let me but you know how it is.  When you develop for the web the way we do you have to test all the browsers.
0
 
LVL 3

Author Comment

by:guadalupe
ID: 1837998
Hey Josh,

One more time...  I think I have a solution but I'm not sure. Can frame sizes be dynamically resized.  If I could then I can always load the complete frame set right away but make the header almost non-exitent with no frame-border or scroll bar and the same background color as the rest of the page.  This way it would not mess with the original main page and then subsequently I would just expand it as necessary. Possible?  How?

Thanks Jason
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1837999
Sorry I've sort of dissappeared.  Kind of busy lately.  I'll respond to the above comment as soon as I can.  (I have to go to a meeting now...)
-Josh
0
 
LVL 3

Author Comment

by:guadalupe
ID: 1838000
No problem, I understand!!!!!!!!  Thanks!
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1838001
OK!  Sorry for the delay.  I worked up a demo, which works with Netscape 3,4 and IE 4 (tested it in those at least).  It may work in others, but I don't have the means to test it.

The demo is in the same place as the last one:
http://aegis.mcs.kent.edu/~jbirk/EE/frames/

I had to add a couple pages which you will have to get the source of.  If you have any troubles getting the source or understaning it, just ask.

-Josh
0
 
LVL 3

Author Comment

by:guadalupe
ID: 1838002
Hey Josh,

I got the script, thanks but I still have the same scrolling problem in NS4 (I didn't even try 3)  I got the right.html and understood the need for th blank.html (though that makes the back button stage trhough the blank page and requires an extra click to go back to the home page).  I think the difference is that with you page, one large graphic forces the scrollbar with my page of have a number of elements that make a longer page than the window size but it seems (just a theory) that this might make the difference thought it shouldn't.   Plus it seems that once I'm in one sub-main page if I GO BACK TO THE HOME PAGE the system/script it no longer works. Maybe we should try the dynamic resize I suggested a couple of frames back.  Also if you want check out my page:

www.amcintl.com/AMC_Frameset.htm
The menu is /menu2.htm
The main page is /AMC_Home.htm
The header is /header.htm
A good test page is /Technology/technology.htm

Though of course you can get all this from the frameset.

 I hope this is not driving you crazy and please tell me if you want to give up as you have already gone above and beyond the call of duty.

- Thanks Jason
0
 
LVL 3

Author Comment

by:guadalupe
ID: 1838003
Hey Josh,

I alread know how to fix the back problem in terms of the script hanging.  You just have to add to the if:

if (top.header && top.main.sub_main)

but the rest is still a mystery
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1838004
hmmm..... well.  Did you try to make the frameset with the scrolling="auto" option?
I tired this one of your pages for the window which needed scrolling and it worked ok.  Copying all of you pages over would take a while though.  If this doesn't work, I may copy over at least a good portion of your files, and then play with it.  Oh and I may need some of the files to be listed on you site with a .txt extension so that the javascript sections with document.write in them don't get ignored.
For now though, try this for your frameset:
<HTML>
<frameset rows="145,*" border=0 onLoad="top.main.sub_main.location=top.initial;">
<frame name="header" src="header.html" scrolling="auto">
<frame name="sub_main" src="blank.html" scrolling="auto">
</frameset>
</HTML>

Also, if that works, maybe using the javascript generated frameset will work with this frameset (less problems with javascript generated version).

Best of luck,
-Josh
0
 
LVL 3

Author Comment

by:guadalupe
ID: 1838005
Hey Josh,

How was your weekend?  I tried the srolling="auto" and "yes" already and neither works.  I´ve put the docs you need up with extensions txt.  What about resizing the frames dynamically it might be easier as well as avoiding a javascript for the targets/links in the menu and the blank screen pass when going forward and back.  Let me know what you think.

Jason PS Aren't you glad you got ropped into this one.
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1838006
I had a pretty good weekend.  I got a color flatbed scanner for $40!  That's pretty cheap!  How about you?

OK, well if the scrolling=auto didn't work for you, then something else is at work here.  Is there content on these pages which is being generated via javascript?  That may be causing a problem.  Either way, I guess I'm going to have to download a good portion of your site so I can properly test it and get something working.  BTW, I like the left frame with the expanding layers.  That's a nice effect and quite useful.

As far as resizing frames dynamically, it's just not possible.  I never responded about that before because I didn't want to get into it, but it's been the topic of a lot of hard questions in the past here on EE.  You can rewrite the frameset creating a new dynamically created frameset again which in effect dynamically resizes the frames, but it's actually creating a new frameset, and refreshing the pages inside the frameset, and may have other nasty side effects which go along with dynamically created framesets (in 3.0 browsers that is).

So, anyway, I guess when I get a bug chunk of time I'll attempt to tackle this problem, but I won't guarentee getting this done in the near future since I have exams, homework, and work to deal with right now.

-Josh
0
 
LVL 3

Author Comment

by:guadalupe
ID: 1838007
Hey Josh,

My week end was good.  Nothing special just a birthday-bbq (not mine).  About the script I understand if your tied up.  About the pages which are being loada into sub-main, no they don't have java generated content.  Im planning on adding some roll overs but maybe now not.  Well see.  Thanks again and good luck with exams.

- Jason PS I put those files up as text.  There not that big (a frames set, menu, home page, and one sub main).  The info is about three comments back.  Also you'll see the script for the menu.  Its a nice one because its set up to work with both browsers (4 of course)  though I do have a similar "refreshing" java script for basically the same effect in v3 will impliment latter and can send you.  Take care and don't forget to sleep.
0
 
LVL 3

Author Comment

by:guadalupe
ID: 1838008
Hey Josh,

I should probably warn you that my boss decided on some restructuring and it looks like the while script mess wont even be necessary.  We my change to the 3 page frame right from the start.  Sorry as I know you busted your butt on this but I wanted to tell you before you spent any more time.  If you like me your probably still curious about how to make it work but then again with the way Netscape has been behaving it may never work.  Anyway I'll get back to you when I have more of a final decision but again for the moment don't waste your time unless its for personal curiosity.

Thanks Jason!!!!!!!!!!
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1838009
OK, at this point I don't think I have the time to look into for curiosity.  Perhaps things like this will be easier with the 5.0 browsers which should be out in the not too far future.
Tell me if you need further assistence on this.
-Josh
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

757 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