473,381 Members | 1,497 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,381 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 8212
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...
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
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: 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
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
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...

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.