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

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.document.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 8214
Gunther Radick wrote on 04 dec 2004 in comp.lang.javascript:
Let's say I've an IFRAME on a page, with an ID of "myFrame".
If I call -

myFrame.document.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.document.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.document.open();
myFrame.document.write();
myFrame.document.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.javascript 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
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)<...
1
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...
1
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...
8
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...
8
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...
8
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...
23
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...
1
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...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...
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
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.