473,765 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tricky IFrame Problem (yes it's about the dynamic height, again)

Hey Guys,
I've done my research for a script that dynamically adjusts the height
of the Iframe, but none of the scripts have the features, which I all
need. Maybe one of you can help me:

1. The site contained in the Iframe is no on the same Domain nor Server
as the main page

2. I can't put any code in the Iframe (YES, I do have permission to
include the Iframe ;-)

3. The height needs to adjust not just the first time the mainpage
loads, but also everytime somebody opens a new site in the Iframe. The
height needs to be readjusted in that case, too.

If the script works for IE only, it'll be better than nothing (as long
as it works for other browsers with scrollbars) and if it works for IE
and Mozilla only I'm good.

Alright.. I hope somebody can help me. I'd be veeeeery grateful.
Thanks.
Flo from Berlin.

Oct 7 '06 #1
11 6011
ASM
f.*******@gmail .com a crit :
3. The height needs to adjust not just the first time the mainpage
loads, but also everytime somebody opens a new site in the Iframe. The
height needs to be readjusted in that case, too.
needs to adjust to *what* ?

any way you can have an 'onload' in the tag of your iFrame.

The only question is how to get informations about a page coming from
other domain.
If the script works for IE only,
Some browsers don't accept to adjust content of their iframes when
taller resized ... :-(

I think you must know previously which height to give to the iFrame
before to send it the new (other) site.
..
Oct 7 '06 #2
Hi Flo!
Sorry, but for a security reasons browsers have a restriction: you
can't access iframe's content with page from other domain (and if you
can't access it you can't know the size of the iframe's content).

Val Polyakh
http://trickyscripter.com

Oct 7 '06 #3
Sorry, but for a security reasons browsers have a restriction: you
can't access iframe's content with page from other domain
I'm quite sure, that there are scripts that make an Iframe adjust it's
height to the content of an off-domain-site but these scripts didn't
have both of the other needed features..

Is there an alternative to Iframes that would get me to my goal? (And
no, I can't include the page via PHP).

Thanks guys.
Flo.

sc********@gmai l.com schrieb:
Hi Flo!
Sorry, but for a security reasons browsers have a restriction: you
can't access iframe's content with page from other domain (and if you
can't access it you can't know the size of the iframe's content).

Val Polyakh
http://trickyscripter.com
Oct 7 '06 #4

f.*******@gmail .com написав:
Sorry, but for a security reasons browsers have a restriction: you
can't access iframe's content with page from other domain

I'm quite sure, that there are scripts that make an Iframe adjust it's
height to the content of an off-domain-site but these scripts didn't
have both of the other needed features..
I am 100% sure you can't access document of the off-domain-site through
iframe. It is standart security policy. If you don't believe - please
read info about cross-domain security at MS and Mozilla sites.
Is there an alternative to Iframes that would get me to my goal? (And
no, I can't include the page via PHP).
I see only one solution. You need server-side proxy script. This script
just reads page from another site and places it to your iframe. Then
you can access and modify this iframe.
If you can't use server side scripting I believe that you might think
about totally different solution (maybe without iframes or without
resize of iframes).

Val Polyakh
http://trickyscripter.com

Oct 8 '06 #5
f.*******@gmail .com wrote:
Hey Guys,
I've done my research for a script that dynamically adjusts the height
of the Iframe, but none of the scripts have the features, which I all
need. Maybe one of you can help me:
I'm curious. Even if you could access the iframe source, how would you
know what height to make the iframe resize to? Is the idea to get rid
of vertical scrollbars or something?

Thanks!
Kev

Oct 8 '06 #6
I'm struggling with the same issue. Closest I've come was with script
found at:

http://guymal.com/mycode/iframe_size.shtml

It's a bit buggy, but it works. (I've tested it on IE6 Win, Camino Mac,
Netscape Mac, Opera Mac - all work.)

On my test page I tried loading cnn.com and google, and both open. (see
here: http://www.lightbulb.co.za/oostco/trackertest.html)

The links to CNN and Google are obviously for testing purposes only...
but it works - cross domain.)

** If you get to fix the "double size" issue in IE, that would be
great, let me know what the code should be. **

Francois.

Oct 9 '06 #7
Before I continue... there is a problem i just found - that subsequent
pages don't resize correctly. The problem here is probably that the
script can not receive page size information from out of domain pages.
The resize works for pages hosted on my domain, but fails to resize
correctly for google and cnn. Some more hunting.

(On the other hand - if you can tweak the files you're calling in order
to tell the script their size - you're halfway there.)

Francois.

Oct 9 '06 #8
Francois schrieb:
Before I continue... there is a problem i just found - that subsequent
pages don't resize correctly. The problem here is probably that the
script can not receive page size information from out of domain pages.
The resize works for pages hosted on my domain, but fails to resize
correctly for google and cnn. Some more hunting.
(On the other hand - if you can tweak the files you're calling in order
to tell the script their size - you're halfway there.)
Yep that's point 3 of my feature list ;-). I agree to you, if it works
so far, there must be a way to solve this problem, also. But how? I'm
unfortunately not good at javascript, at all.

@ Keven Darling:
You guessed right: the goal is, to adjust the Iframe to the height of
the contained website, in order to prevent scrollbars, in order to make
it look like the mainpage.

And we're still searching for the script that fulfills all our dreams
;-)

Oct 9 '06 #9
Flo,

Don't have much time, but it seems like there's some helpful stuff
here:

http://www.daniweb.com/techtalkforums/thread27719.html

Anyway, I'll be searching.

Francois.

Oct 10 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
7620
by: Thomas | last post by:
Hi there, I have an iframe which is editable (designMode = "on") and want to resize it dynamically as the content grows (e.g. more lines of text is in there) and there the struggle starts. I fill the iframe with content (<body> tag and so on and also insert a <div> tag, inbetween is the content that should be modified). Now if the event "overflow" or "underflow" is triggered the iframe
2
47343
by: Templar | last post by:
Hi i'm bothering with such problem... I must dynamic create an Iframe, and then put som raw HTML into it. But I can't. When I create iframe, I can't access its properties. Here's the coe snipplet: //************************************* //*************************************
6
4961
by: SF RVN | last post by:
I have searched NUMEROUS sources in an effort to find the magic (script, styles, syntax, etc.) that will allow me to create a web page with the following format: |----------------------------------------------------------------| | Discrete table used as 'banner' | | DONE! | |----------------------------Table 1-----------------------------| ...
1
2691
by: Robert de Ridder | last post by:
I use an asp page to display pages, where the dynamic content is in an iframe. To calculate the height of the iframe I use the calcheight function. However when trying to do this with external pages, I get an access denied error, and the iframe won't display correctly. Is there a way to solve this or another way to calculate the height for the iframe. The relevant code displayed below. Thanks in advance for any help,
0
5893
by: dimepiece18 | last post by:
On our Intranet homepage, I have a layer with an iframe contained in it. The iframe is linked to an html document that is stored in our Content Library system. You have to be authorized to view the documents in Content Library. The problem I'm having is that when you launch the Intranet site, the SSO login screen appears, but it looks like the iframe is trying to launch the html file before the homepage loads. So after you log in, the iframe...
8
5371
by: hyejin | last post by:
I have a problem with dynamic iframe and document.close() on Firefox. Below two files create a dynamic iframe by JavaScript. These two samples do not have any problems on IE. But, on Firefox, the icon on the top corner keeps running with "loading" message on the bottom status bar even though the browser completed everything in the iFrame. The line that causes the problem is "document.close()" in the included JS file. If this line is...
3
5397
polymorphic
by: polymorphic | last post by:
I have succeeded in embedding PDF files in a dynamic iframe. The problem is that I need the PDF to cache. If the PDF remains the same from page load to page load then the pdf is somehow cached with the html page. But if I try to navigate to another pdf in the IFRAME then no caching occurs. Is the problem in the IFRAME reloading instead of just refreshing the pdf? <SCRIPT type="text/javascript"> var pageNo; var nav; var iframe; var...
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10161
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7378
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.