Closed Bug 289102 Opened 19 years ago Closed 19 years ago

unable to access window.open, document.write content using getElementById

Categories

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

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jepsar, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050404 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050404 Firefox/1.0+

var winObj = window.open("", "mywin");
winObj.document.open();
winObj.document.write('<html><body><div id="myId"></div></body></html>');
winObj.document.close();
alert(winObj.document.getElementById('myId'));
----
code above alerts 'null'

alert(winObj.document) alerts '[Object HTMLDocument]'

The DOM inspector is able to locate te div and sees the id

I'll put a test case online tonight (CET)

Reproducible: Always
Not a jseng bug. I tried this on multiple builds and as long as the popup is
allowed, it works for me. Over to dom 0. If you can reproduce with popup
blocking disabled for the site, please reopen.
Assignee: general → general
Component: JavaScript Engine → DOM: Level 0
QA Contact: general → ian
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
(In reply to comment #1)
> Not a jseng bug. I tried this on multiple builds and as long as the popup is
> allowed, it works for me. Over to dom 0. If you can reproduce with popup
> blocking disabled for the site, please reopen.

Sorry, I'm unable to reproduce this now. Must have been something else in the
code what coused problems. I've been messing arround to get it working in
Firefox *and* MSIE.
You need to log in before you can comment on or make changes to this bug.