473,378 Members | 1,346 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,378 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 9276
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"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.