开发者

How to grow iframe height to match content

I'm aware that this question has been as开发者_如何学Goked a number of time on SO and have looked over many of the posts but none seem to be as restrictive. I may not be able to do anything about this but I want to ask.

I need the content within an iframe to grow and shrink with the content. The main problem that I see is that javascript cannot be used because the site providing the framed content will only provide an iframe tag with a link to its content. There is of course no guarantee that the site where the iframe is placed will allow javascript so I don't see that as an option.

Is there another alternative to an iframe that will allow me to import dynamically growing and shrinking content that doesn't rely on javascript?


You can use PHP on the server-side to retrieve the content and then include it within the page. You can strip out the meta-data, and adjust the CSS and HTML with Xpath if you need to.

If it's a completely different bit of content for which adjusting the CSS and HTML won't work, then an iframe does remain about the only solution. If you have access to a server with a GUI, you could load the page and store the height in a database, and then set the height of the iframe on load.


Try this:

http://kinsey.no/blog/index.php/2010/02/19/resizing-iframes-using-easyxdm/

I believe it still works.


I'd say that with current technology and browsers, this just cannot be done. Not without JavaScript.

And it's not pretty even with JavaScript.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜