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

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
14 years ago
14 years ago

People

(Reporter: jepsar, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
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

Comment 1

14 years ago
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

Updated

14 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → WORKSFORME
(Reporter)

Comment 2

14 years ago
(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.