Solved

Javascript to auto resize an iFrame

Posted on 2007-11-19
4
1,950 Views
Last Modified: 2009-12-16
Hi

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!!

http://clients.fruit-studios.com/curtisfrank/search.html


Many thanks in advance

-s-
0
Comment
Question by:socross
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
Mr_Splash earned 500 total points
ID: 20311677
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."

http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm
0
 
LVL 1

Author Comment

by:socross
ID: 20311703
perfect thanks

will try and implement shortly

-s-
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20311922
Interesting... If the other one does not work and this does...
0
 
LVL 1

Author Comment

by:socross
ID: 20316924
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.

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_22965420.html

Thanks to all

-s-
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

813 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

9 Experts available now in Live!

Get 1:1 Help Now