473,785 Members | 2,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.write to an IFRAME - odd effect

Let's say I've an IFRAME on a page, with an ID of "myFrame".
If I call -

myFrame.documen t.write( "Something" );

the "Something" gets written to the IFRAME, as expected, but
the browser (and this happens with all four major browsers)
continues to "load" the page. Even if there's nothing else left
to load.

Has anyone else noticed this? Is there a way around it?
Jul 23 '05 #1
2 8242
Gunther Radick wrote on 04 dec 2004 in comp.lang.javas cript:
Let's say I've an IFRAME on a page, with an ID of "myFrame".
If I call -

myFrame.documen t.write( "Something" );

the "Something" gets written to the IFRAME, as expected, but
the browser (and this happens with all four major browsers)
continues to "load" the page. Even if there's nothing else left
to load.

Has anyone else noticed this? Is there a way around it?


How do you notice that "continue to load"?
Jul 23 '05 #2
Gunther Radick wrote:
Let's say I've an IFRAME on a page, with an ID of "myFrame".
If I call -

myFrame.documen t.write( "Something" );

the "Something" gets written to the IFRAME, as expected, but
the browser (and this happens with all four major browsers)
continues to "load" the page. Even if there's nothing else left
to load.

Has anyone else noticed this? Is there a way around it?


Assuming that myFrame is a valid reference to the IFrame and not an IE
shortcut to it:

myFrame.documen t.open();
myFrame.documen t.write();
myFrame.documen t.close();

When you are remotely writing to a document (from anywhere other than
the page), you close() the document to let the browser know you are
finished writing, otherwise the browser is waiting for more instruction
so the page "continues loading".

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #3

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

Similar topics

2
1947
by: DJ WIce | last post by:
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.height=parseInt(this.docume nt.body.scrollHeight)+2+'px';
1
5440
by: Robert Oschler | last post by:
I have two sites, both with valid P3P policies that passed the W3C P3P validator, including the P3P compliant HTTP headers test. On one of the sites, Site A, I have a web page that loads a document from Site B in an IFRAME. In this context the web page on Site A is the "originating" document and the web page on Site B is a 3rd-party document (since it's from a different domain). I thought that having a valid P3P policy would make IE6...
1
1542
by: Jesse Liberty | last post by:
Hi. I'd like to create an xml document on the fly and then display it in an asp.net page. I can use an iframe and point to a URL (which displays perfectly), but I'd not like to save the xml to a file (it will be built as I go along). I can use the <asp:xml> control, but I don't want to have to write the XSLT, I love the one I get for free within IFrame.
8
9421
by: '69 Camaro | last post by:
Perhaps I'm Googling for the wrong terms. Does anyone have links to examples of the syntax necessary to read the HTML on another Web page when that HTML is produced from JavaScript using the document.write( ) method? For a simplified example, I have two Web pages. Page 1 uses JavaScript with the following: htmlData = "<B>This is bold text.</B>"; document.write(htmlData);
8
52830
by: Henrik Stidsen | last post by:
I am trying to access a table in an iframe via javascript. It sounds easy - but it won´t work... The iframe is added to the document via someContainerElement.innerHTML = "<iframe...>", it has name and ID and its visible in my DOM explorer just as the table I need is it. The table is added from ASP.NET via Response.Write(). I have tried both window.frames, document.getElementById and even document.getElementsByTagName, nothing has...
8
5373
by: hyejin | last post by:
I have a problem with dynamic iframe and document.close() on Firefox. Below two files create a dynamic iframe by JavaScript. These two samples do not have any problems on IE. But, on Firefox, the icon on the top corner keeps running with "loading" message on the bottom status bar even though the browser completed everything in the iFrame. The line that causes the problem is "document.close()" in the included JS file. If this line is...
23
6633
by: vunet | last post by:
It is recommended by some sources I found to create IFrames in IE using document.createElement('<iframe src="#">') instead of document.createElement('iframe'). Why and what browser versions to use it? IE5 or IE6? Thanks
1
6511
by: raviviswanathan.81 | last post by:
Hello, So we have a webmaster who sets document.domain to some domain. After that, we try to create and inject text inside an iframe by getting the iframeID.contentDocument (or iframeID.contentWindow.document for MSIE). This results in an 'access denied' issue in MSIE (No problem in Mozilla). Note that if there is document.domain initialization before this iframe creation/content injection, there is no problem and all works well.
0
9481
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
10341
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
10155
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
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9954
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...
1
7502
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
6741
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
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2881
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.