473,796 Members | 2,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

triger when document.write is done ?

Hi,

I want to resize an IFRAME.
It works nicely when I try to resize the frame with a commant loaded via

onfocus="if (parseInt(docum ent.body.scroll Height)<
parseInt(docume nt.body.offsetH eight))

parent.document .getElementById ('iframeID').st yle.height=pars eInt(this.docum e
nt.body.scrollH eight)+2+'px';
else

parent.document .getElementById ('iframeID').st yle.height=pars eInt(this.docum e
nt.body.offsetH eight)+1+'px';" onload="this.fo cus();"

in the IFRAME body tag.

But I want is to resize the IFRAME when it's content is fully loaded. The
problem is that the content is put in via a javascript.

Even if I put the above lines "if.. else .." under the document.write
commants the this.document.b ody.scrollHeigh t will return 0px.
Please help.
Wouter
Jul 20 '05 #1
2 1947
DJ WIce wrote:
Hi,

I want to resize an IFRAME.
It works nicely when I try to resize the frame with a commant loaded via

onfocus="if (parseInt(docum ent.body.scroll Height)<
parseInt(docume nt.body.offsetH eight))

parent.document .getElementById ('iframeID').st yle.height=pars eInt(this.docum e
nt.body.scrollH eight)+2+'px';
else

parent.document .getElementById ('iframeID').st yle.height=pars eInt(this.docum e
nt.body.offsetH eight)+1+'px';" onload="this.fo cus();"

in the IFRAME body tag.

But I want is to resize the IFRAME when it's content is fully loaded. The
problem is that the content is put in via a javascript.

Even if I put the above lines "if.. else .." under the document.write
commants the this.document.b ody.scrollHeigh t will return 0px.

Couldn't you use the onload() function?

<body>
<script language="JavaS cript">
<!--
window.onload = function () {
if (xyz) mickey();
else mouse(true);
...
}

//-->
</script>

</body>
Jul 20 '05 #2
: > But I want is to resize the IFRAME when it's content is fully loaded.
The
: > problem is that the content is put in via a javascript.
: >
: > Even if I put the above lines "if.. else .." under the document.write
: > commants the this.document.b ody.scrollHeigh t will return 0px.
: >
: Couldn't you use the onload() function?

No that doesn't work, it seems that the onload is triggered before the
content is written if you use document.write.

I did solve the problem I use
<IFRAME STYLE="display: none;" ID="iframeID" src="content.ht ml"></FRAME>

in content.html I use <body onfocus="resize script"> and then use:
document.frames ("iframeID").do cument.body.foc us();
When I make the IFRAME visable in the parent when a mouse clicks.

:-) strange but this works (unless one clicks very fast).
So if you know a way to detect if all document.write comments have been done
it would be nice, it looks like the browser builts/interprets dynamicly, not
in the way the page gives the data even for javascript..

Wouter
Jul 20 '05 #3

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

Similar topics

3
9846
by: Catherine Lynn Smith | last post by:
I am creating a webpage with dhtml <DIV> layers and I want a link on one layer to modify the content on another but I seem to keep running into errors. Basically I create a layer in the middle of the screen that initially comes up with a gif image of a house: <!-- start "house" layer definition for center of screen --> <DIV id="house" style="position:absolute; left:140px; top:137px; width:510px; height:325px; z-index:2"><img...
9
6362
by: James Marshall | last post by:
I'm writing a library where I want to override document.write(), but for all document objects; thus, I want to put it in the prototype. I tried Document.prototype.write= my_doc_write ; but it didn't work. I discovered that this seemed to work: HTMLDocument.prototype.write= my_doc_write ; Why does HTMLDocument work here but not Document? Will this second
3
2451
by: Jan Ebbe Jensen | last post by:
Hi I have tried the following code. It works in Mozilla. In IE I'm not able to enable DesignMode? What have I done wrong? It says that obj is undefined? Can anyone help me please.
1
1820
by: mrbog | last post by:
Using the WebBrowser control, can someone load one of my web pages and see the HTML that has been generated by document.write() javascript? For example, if I have a page that has obfuscated javascript that does a document.write(), I'm not concerned if someone can view that javascript (because it won't be easy to un obfuscate the javascript). But, using the webbrowser control could someone see the HTML that the document.write generated?
9
4923
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work fine from a link. The button does bring up the popup window, but when I press the links on the page, it doesn't return or close the window. ****************************************************************************
4
1136
by: T Perkins | last post by:
is there a way to have intellesence give a list of options for each parameter of a newly create functions. an example would be, using messagebox.show. after you put in the message and label, you have a list of different type of button styles(MessageBoxButtons.OKCancel), then a list for icon(MessageBoxIcon.Warning). i am attempting to create a common function for programs to use at work. i am thinking it would be easier for the other...
11
3113
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a non-trivial exercise. inserting '&lt;' and '&gt;' causes the browser to write the text to the page as literal text rather than as the intended script element. Using escape codes seemed to work (makes it standard compliant) but the text is not written to...
17
5108
by: Zytan | last post by:
I can scroll a WebBrowser to the bottom like so: if (webControl.Document != null) webControl.Document.Body.ScrollTop = int.MaxValue; But, if I include a proper DOCTYPE (for XHTML 1.1 DTD) like so: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
9
30147
by: nicnac | last post by:
Hi, I'm self learning javascript - so any pointers are welcomed!! I have an issue passing a form and array from one function to another. I tried many variations ! I can't get this to work and I can't get this issue out of my head !!!! So I'm obviously missing something really simple and can't see it or it can't be done with my limited knowledge. I know that I can use a cookie to store the array as string - I have this working but...
0
9680
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
10456
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
10230
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
10012
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
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 project—planning, coding, testing, and deployment—without 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
7548
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
5442
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...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
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

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.