473,659 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript in containers (iframe)

I want to know the recommended way to handle scripting of/with
containers such as an iframe. I have a page with border-navigation
bars on the top/bottom/left/right and I want to use an iframe to load
content in the middle.

I would like, if possible, to have the parent window resize itself to
suit whatever is loaded into the iframe container, deriving the size
needed from calculated values. Thus the calculation would have to
over-ride default and/or previous settings for the size of the initial
iframe after all of the associated container content has been fully
loaded and rendered.

Any information and assistance is appreciated.

KL

P.S. Also, as a side note... I have noticed some less than favorable
results in netscape for deriving calculated size as well as iffy
ability to force and/or calculate the height of such content to fully
fill the frame. Any tips on how to force said content to fully fill
and/or expand the container vertically would also be appreciated.
Jul 20 '05 #1
3 9299
In article <5f************ **************@ posting.google. com>,
kl*****@hotmail .com (Catherine Lynn Smith) writes:
I want to know the recommended way to handle scripting of/with
containers such as an iframe. I have a page with border-navigation
bars on the top/bottom/left/right and I want to use an iframe to load
content in the middle.

I would like, if possible, to have the parent window resize itself to
suit whatever is loaded into the iframe container, deriving the size
needed from calculated values. Thus the calculation would have to
over-ride default and/or previous settings for the size of the initial
iframe after all of the associated container content has been fully
loaded and rendered.

Any information and assistance is appreciated.
Set the IFrames width and height, same as you would a normal frame (if there is
such a thing). document.frames['IFrameName'].widht/height
KL

P.S. Also, as a side note... I have noticed some less than favorable
results in netscape for deriving calculated size as well as iffy
ability to force and/or calculate the height of such content to fully
fill the frame. Any tips on how to force said content to fully fill
and/or expand the container vertically would also be appreciated.


http://webtips.dan.info/force.html
--
Randy
Jul 20 '05 #2
hi************@ aol.com (HikksNotAtHome ) wrote in message news:<20******* *************** *****@mb-m27.aol.com>...
In article <5f************ **************@ posting.google. com>,
kl*****@hotmail .com (Catherine Lynn Smith) writes:
I want to know the recommended way to handle scripting of/with
containers such as an iframe.

I would like, if possible, to have the parent window resize itself to
suit whatever is loaded into the iframe container, deriving the size
needed from calculated values. Thus the calculation would have to
over-ride default and/or previous settings for the size of the initial
iframe after all of the associated container content has been fully
loaded and rendered.

Any information and assistance is appreciated.


Set the IFrames width and height, same as you would a normal frame (if there is
such a thing). document.frames['IFrameName'].widht/height


I do intilize the iframe with a standard size then have it resize to
fit the size of the browser. Currently, the border design is built
around an 800x600 window size so I set a 'minimum' value for the x and
y that if the browser is made smaller than this amount, the border
content 'stops' getting smaller and the scroll bars thus turn on to
provide panning.

Due to the size of the borders, however, the center content area ends
up being only about 500x400 in size and some of the pages I want to
load into that iframe are going to need more size than this. I would
like, if it is possible, to 'read' the calculated minimum 'width' and
'size' from the iframe content after it is reloaded then reset the
minimum values for the total parent window size based on this center
content minimum width and height.

I currently have the scroll bars turned off on the iframe, and would
thus like to reset the minimum and redraw the borders so the parent
window scroll bars will facilitate panning of the entire page (center
content in the iframe + the borders on the parent window) but I am not
sure how to:

1) have the browser derive the 'needed' minimum size for the iframe
prior to doing any resizing of the parent window. (due to the fact
the iframe size is previously 'fixed' in size, any values I have tried
to extract from the DOM relate to it's present size)
2) I am still a tad confused on the scope between the iframe and the
parent window as far as navigating the DOM nodes is concerned or the
variables and assignments in the javascripting.

I am guessing that it may be necessary to hard code the sizing
requirements somewhere in all the center content pages which I would
like to avoid if possible should there be any way to derive the
necessary sizing values from calculated properties. But even if I
hard code or find a way to extract the necessary parameters, I am
still unclear on how to pass that information to the parent window or
extract the values from the iframe.

KL
Jul 20 '05 #3
As an addendum, while waiting for my message to post and to get any
consequent replies, I have figured out how to read the properties
either from the internal content or from the parent frame. But that
still leaves me with the javascript scope questions.

One of my goals is to try to leave the pages loaded into the center
area as 'dumb' as possible (i.e. the less parent specific nonsense in
them the better as I will probably create a wrapper or at least a test
to send people too lazy to upgrade their browsers off to these pages
directly rather than load them into my border page)

Now that I am able to read and set the values I need, I need to figure
out how to trigger the actually event to resize them. Of course, the
simplest would be an 'onload' event in the HTML of the child page
being loaded into the iframe, but as I just mentioned, I want to avoid
any parent specific coding if possible in those content pages.

Is there a way to trigger a function call 'from the parent page' when
the iframe (child) is done loading and rendering?

KL
Jul 20 '05 #4

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

Similar topics

7
10902
by: Lorenzo Vaina | last post by:
Can i get the content of an URL and put it in a variable using javascript? I want js execute different operations varying a file that is on internet. Thanks, regards.
2
2874
by: Robert Oschler | last post by:
I have an IFrame whose document is created completely by Javascript code at runtime. The document in the IFrame accesses Javascript functions in the top level document. This works fine most of the time. But every now and then, when I hit the back button, the browser suddenly thinks the Javascript created document in the IFrame is not from the same domain as the topmost document, and therefore I start getting "permission denied" errors...
3
1739
by: webguru | last post by:
I am trying to be able to pass a parameter in my URL to a subpage that will load the file specified in the paramater into an IFRAME. I have hardly used Javascript, and am trying to figure out how I would do this. My URL should always look like this: www.xxx.com/newsite/subpage.html?Page=filename.html The javascript I came up with looks like this, because I will only have one parameter and I know that with the ? and the = that the...
5
2194
by: Tudor Tihan | last post by:
Hi, This is my first post here, so please be kind. I have tryed to make a javascript html page loader by using an invisible <IFrame> and some javascript variable text passing between entities. This seems to brake the CSS after some depth, or perhaps I am not understanding something.
8
3657
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
18
43539
by: Chris Ianson | last post by:
Hi geniuses (or is that genii, or genies) The challenge is as above really. I have a page with an iframe in it, and need to call a JS function in the *parent* page, *from* inside the iframe. (It's for Google Maps, but I won't bore you with the complexities of that, as it doesn't affect the question). Mochas kudos to anyone able to solve this widdle.
16
1828
by: Phlip | last post by:
Javascripters: I have a page with an iframe inside. Let's say the iframe looks like this: <script src="/javascripts/prototype.js" type="text/javascript" /> .... <iframe id='grinder' src='sample.html' > </iframe> That prototype.js gives us goodies like $(). And sample.html looks a little
5
7700
by: brad | last post by:
I'll post my code below. My goal is to grab the selected text in an iFrame from javascript (really any way possible). When I highlight text in the iFrame and click the link outside of the iFrame, I receive the following error: Firefox FireBug Error uncaught exception: Permission denied to get property HTMLDocument.getSelection IE7 Error
9
16903
by: gwong123 | last post by:
Hey, I need to convert this javascript code into iframe. The javascript goes into a server and brings out an ad banner. The X's is the server IP. <script language="javascript" type="text/javascript" src="http://XXX.XXX.XXX.XXX/blahblah/0000/blahblahblah.php"></script> What I need to do is convert that line of code into an iframe format so that it does the same job of going into the server and pulling out the banner. Right now if I just...
0
8427
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
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
8746
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...
1
6178
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
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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
2749
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
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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.