: Auto-sizing an iframe


skoolmunkee
Hey all.

I am helping someone, and I need to put some dynamic (blog-type) content inside an iframe. We want it to resize to fit the content because it could be longer or shorter depending on how much is there. We don't like that little iframe scrollbar you get with absolute iframe height - but there's apparently no way to force the parent HTML page into comforming to an iframe's content. We've tried tables, nested tables, percentages, asterisks, etc... iframe tutoring pages don't mention it, and help forums either say "can't be done" or "yeah this thing works" but it ends up not working.

Any ideas?

FYI, my friend would just use the SSI virtual include tag, but his server isn't supporting ssi (even though they say they are).

Any ideas? He'd probably be open to another solution, provided it is simple and doesn't require a bunch of coding crap like javascript.

MaRiNe
www.tblog.com

Has some helpful topics, and templates.

Overcaffeinated
As far as I know, it can be done with a heap of incredibly ugly javascript. You'd have to "count" the number of characters in the included document (the one inside the iframe), convert that to your expected height/width (according to your measurements) and then rewrite that value in your main document. I have no idea how this would behave due to download times, though. I wouldn't recommend it or try to implement it either. Too much bother, I say. It would be better to try to integrate it in the same page via an automated solution like Blogger or something.

skoolmunkee
OK, that's basically what we thought, Sergio. ^_- Thanks! I'll have to tell my friend I couldn't find anything helpful.

He wants to just use the SSI tag to <!--#include virtual--> (or something like that), but as I said, his server is being a jerk about it. There are a few other solutions to try, but none of them as tidy as SSI or an iframe.