[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Javascript to auto resize an iFrame

Posted on 2007-11-19
4
Medium Priority
?
1,971 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Suggested Courses

829 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