473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 9279
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
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
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...
3
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...
5
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...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
18
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. ...
16
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'...
5
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...
9
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"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.