Closed Bug 35250 Opened 24 years ago Closed 23 years ago

Creating <IFRAME SRC="about:blank"> and document.writing to it fails [frame]

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

VERIFIED DUPLICATE of bug 22681
Future

People

(Reporter: martin.honnen, Assigned: alexsavulov)

Details

(Keywords: dom1)

Attachments

(1 file)

I am creating a blank iframe and then try to document.write to it. I get an 
error that the iframe's document has no properties. If I use setTimeout with a 
one millisecond delay it works but I can't quite believe that that (incredible 
small) delay is necessary to access the document and hope it is possible to make 
it immediately available.

<HTML>
<HEAD>
<SCRIPT>
var n = -1;
function createBlankIframe () {
  n++;
  var iframe = document.createElement('IFRAME');
  iframe.id = iframe.name = 'iframe' + n;
  iframe.src = 'about:blank';
  document.body.appendChild(iframe);
}
function writeToIframe() {
  var ifrWin = window.frames['iframe' + n];
  ifrWin.document.open();
  ifrWin.document.write('<H1>Kibology<\/H1>');
  ifrWin.document.close();
}
</SCRIPT>
</HEAD>
<BODY>
<BUTTON ONCLICK="createBlankIframe(); writeToIframe();">
create blank iframe and write to it
</BUTTON>
<BUTTON ONCLICK="createBlankIframe();">
create blank iframe
</BUTTON>
<BUTTON ONCLICK="writeToIframe()">
write to iframe
</BUTTON>
<BUTTON ONCLICK="createBlankIframe(); setTimeout('writeToIframe();', 1)">
create blank iframe and write delayed to it
</BUTTON>
<BR>
</BODY>
</HTML>
I think this is really a dup of bug #17351, that bug is about the same problem
but that bug uses window.open(...) in stead if <iframe src="...">, I'll leave
this open to track that this is fixed when #17351 is fixed...
Status: NEW → ASSIGNED
QA Contact: gerardok → desale
Target Milestone: --- → M19
NS 4 look better whitout this thing
now it looks like IE
Bug #17351 is marked fixed, but that doesn't seem to be affecting this bug.  I 
still get null as the document property of an iframe with no src.
Reassigning to Eric Pollmann since we talked about this and we had some ideas on
how to solve this, Eric, feel free to either dupe this against one of the other
bugs on the same issue or Future this, or whatever...
Assignee: jst → pollmann
Status: ASSIGNED → NEW
OS: Windows 98 → All
Hardware: PC → All
This bug has been marked "future" because the original netscape engineer working
on this is over-burdened. If you feel this is an error, that you or another
known resource will be working on this bug,or if it blocks your work in some way
-- please attach your concern to the bug for reconsideration.
Status: NEW → ASSIGNED
Target Milestone: M19 → Future
dup of bug 22681?
Keywords: dom1
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala
Is this why the LinuxToday page renders incorrectly?
   <http://linuxtoday.com>
Note the long gray box on the left, which is, in fact, an IFRAME in which the
SRC attribute resolves to a piece of Javascript code. If this appears to be a
different bug, i will post a new bug and write a minimal test case.

It seems that this page rendered correctly a few months ago.
I believe Jesse was right back in november, this is most likely a dup of bug 22681.
Bulk reassigning form bugs to Alex
Assignee: pollmann → alexsavulov
Status: ASSIGNED → NEW
Summary: Creating <IFRAME SRC="about:blank"> and document.writing to it fails → Creating <IFRAME SRC="about:blank"> and document.writing to it fails [frame]
Does this still happen? If not, it was probably a dup of (fixed) bug 22681.
The test case
  http://bugzilla.mozilla.org/attachment.cgi?id=7397&action=view
works for me with M 0.9.7.
I resolve as duplicate of 22681

*** This bug has been marked as a duplicate of 22681 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
no, this bug cannot be marked dup of bug 22681, because bug 22681 was resolved 
as dup of this bug.
I have some trouble understanding your logic on this one, Sivakiran :-)
bug 22681 was never marked as a dup of this one as far as I can tell, and bug
22681 is fixed (apart from an edge case which is why the bug is still open)
this is a dupe of bug 22681, did not i say so before :-)
verified dup, marking as verified
Status: RESOLVED → VERIFIED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: