Link to home
Start Free TrialLog in
Avatar of sciwriter
sciwriter

asked on

dynamic Iframe height (or Div) no scripting

Iframe's don't seem to be able to resize to the height of a document going into it.

On a big site, MANY pages of varying lengths may load into an Iframe, each of which must be findable by search engines, meaning "clean" links --  www.site.com/content/2014a.html

So a simple link seems necessary -- <A href="2014a.html" target="main">
<IFRAME name="main" width="400" height="[dynamic]"></IFRAME>

With dynamic = 100%, and with the enclosing html "height=100%" it doesn't work.  When a pixel height is stated, the Iframe can't resize the fit the text, and scrollers are not an option.
 
Using DIVs instead, makes the property inheritance easy -- no special <BODY bgcolor=...> to set the Iframe color, and so forth.  It's important for the many "loaded" pages to be as simple as possible.

Loading into a DIV, however, seems not to work without dynamic scripting, and of course, all this could be done with JS -- but then the links aren't found by S.E.s.  Also the master site has much HTML layout already, and I don't think it could all be recast in CSS layout, without causing other issues.

You understand the problem, the need for clean links, but a global class inheritance for the Iframe or DIV, and the need to load without scripting.  I need to get as many different workable ideas as possible toward a solution.   Thanks.
SOLUTION
Avatar of GrandSchtroumpf
GrandSchtroumpf

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
Avatar of sciwriter
sciwriter

ASKER

<< Are the pages you need to load inside your iframe on the same domain>>
Yes, all.
 
<<can use a javascript>>
If you load the pages by JS, search engines won't find them easily.
I thought of using a JS routine to resize the frame (along with a normal link), but when you start talking of 100+ pages, that becomes a big job... the JS code tricky enough, but adding it to 100s of links.... !!

I also considered the long iframe too, but what that seems to require is essentially nothing on the page below the frame position -- i.e. put ALL info in the page above the iframes.  That is still an option.

These are great thoughts, GrandSchtroumpf, keep 'em coming if you have any more.  Much appreciated.

How do you feel about using DIVs instead of Iframes, and is this workable for a simple S.E. friendly link?
SOLUTION
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
Yes, now if there was a way to automatically spawn that JS routine, without having to hard code it into every link, that might be the ticket.

Cd& -- while you are here, please give some input on replacing the Iframes with DIVs -- this is a viable option, as I see it, keeping in mind the need for clean links for S.E.s -- any thoughts on what would be needed with a DIV setup?  I much prefer the class "inheritance" of DIVs to the class independence of Iframes, but ... well, you tell me...
SOLUTION
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
SOLUTION
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
SOLUTION
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
<< consider moving to PHP or JSP >>

I did, and am back to HTML -- lot easier (and S.E. friendly) to put pages into an iframe than deal with PHP
:)

Iframes seem ideal, except for the non-resizability.  I've read that Google hates standard framesets.

Keep thinking on various ideas.  The input is great.  Points can ++.

This is a nut that has not been cracked, AFAIK ....
SOLUTION
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
SOLUTION
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
Already the input warrants 500 points A PIECE to EACH of you -- and I still want more ideas than these, they are top-notch from both of you.  What to do, and still keep these ideas coming?  A new day brings new ideas, and I cannot stress enough how crucial this entire issue is to big sites with many pages ....

Perhaps revisit tomorrow with some new twists?  Cd& -- how to get you both max points and still more for more ideas?  

G.S. <<That's why you need to put your menu inside the iframe and not the content.>>
That's an interesting idea, I will have to think on that for a while, maybe overnight....
>>>how to get you both max points

Not permitted under the rules.  I have a very strong advocate of the strict interpretation of the cap and I'm record favouring that it belowered.  

The points no longer represent what they once did, so just an ordinary split is fine.

Cd&
ASKER CERTIFIED SOLUTION
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
First, GrandSchtroumpf, I want to hear more of these ideas -- they are crucial to everyone hitting up against the limits of HTML -- will you join me in a continuation of this thread?  Your input, I feel, would be invaluable to everyone struggling with the same issue as me.  I will post a continuing link tomorrow.  Please consider jumping in that thread as we left off here, I want -- need -- to know more.

Second, CD& -- I know you oppose 500 points -- I was there, and you don't remember, but I do.  If you want to see the ultimate in 500 points awarded to trivial answers, just visit the JS thread, where I spent a lot of time and got a lot of points.  I would slog my guts out to help people, only to see others get 500 points for an answer that took only 1 line!!  It was so frustrating, I left that section for good.

Cobol, I was into computers about the same time as you, and I have to tell you, that philosophically, you cannot expect these young experts to have the same "principles" as you.  Things change, and we old timers need to adapt to the changes too.  You need to be "gracious" in accepting that this Q is a very important issue for big, interactive, quickly responsive site development, and allow yourself the leeway of max points for valuable input.  I want you to join me in the continuation of this thread too, NO arguments, either.  I know where you are coming from, but I'm telling you, you HAVE TO ADAPT!!

Thank you both for some stupendous ideas.  You have earned the points.  But this issue is a big one, and I want you to join me in the continuation of it, where we left off here -- NO arguments, please !!!

:)))))
BTW -- the EE system forced me to accept only one answer as the "accepted answer".  That is a failing you can correct, Cd&.  Both of you put in equally great ideas, it is unfair to have to choose one over the other :)
Please both join this new thread with your input -- GS, don't forget to explain the menu links in Iframe clearer.

Many thanks to you both --

https://www.experts-exchange.com/questions/21351836/IFrames-vs-DIVs-balance-and-efficiency.html
What if you get a "access denied" error?
This is ancient history and the answer is no longer valid.


Cd&