473,395 Members | 1,919 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,395 software developers and data experts.

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(document.body.scrollHeight)<
parseInt(document.body.offsetHeight))

parent.document.getElementById('iframeID').style.h eight=parseInt(this.docume
nt.body.scrollHeight)+2+'px';
else

parent.document.getElementById('iframeID').style.h eight=parseInt(this.docume
nt.body.offsetHeight)+1+'px';" onload="this.focus();"

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.body.scrollHeight will return 0px.
Please help.
Wouter
Jul 20 '05 #1
2 1930
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(document.body.scrollHeight)<
parseInt(document.body.offsetHeight))

parent.document.getElementById('iframeID').style.h eight=parseInt(this.docume
nt.body.scrollHeight)+2+'px';
else

parent.document.getElementById('iframeID').style.h eight=parseInt(this.docume
nt.body.offsetHeight)+1+'px';" onload="this.focus();"

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.body.scrollHeight will return 0px.

Couldn't you use the onload() function?

<body>
<script language="JavaScript">
<!--
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.body.scrollHeight 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.html"></FRAME>

in content.html I use <body onfocus="resize script"> and then use:
document.frames("iframeID").document.body.focus();
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
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...
9
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...
3
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
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...
9
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...
4
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...
11
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...
17
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...
9
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...
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
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?
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
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,...
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...
0
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...

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.