• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1972
  • Last Modified:

Javascript to auto resize an iFrame


Does anyone have any javascript for resizing an iframe, a client does not want to have scrolling bars but needs to pull content from another website which is providing a search service for them.

Ideally it needs to get the content height and set the size of the iframe.

Alternativly can anyone reccomend another method for pulling content from another url and displaying it in my page. Never really used frames so would not know the best way to use them, the page is built with html/css and cant lose any formating.

Here is my current attempt!!


Many thanks in advance

  • 2
1 Solution
The following works well

"resizing the IFRAME to be the height of the page contained within it, eliminating any possible IFRAME scrollbars from appearing while snugly showing the entire external content."

socrossAuthor Commented:
perfect thanks

will try and implement shortly

Michel PlungjanIT ExpertCommented:
Interesting... If the other one does not work and this does...
socrossAuthor Commented:
The script does exactly what is required but only for documents from the same domain.

See this question for the required steps to use the script with content from another domain, it uses curl to get the required html and displays it in the iframe.


Thanks to all

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now