Unable to traverse using DOM into IFRAME documents

VERIFIED INVALID

Status

()

Core
DOM: Core & HTML
--
major
VERIFIED INVALID
15 years ago
10 years ago

People

(Reporter: andreas, Assigned: jst)

Tracking

Trunk
All
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212

There are two test files test.html and test1.html:

test.html:

<html>

<script language="Javascript">

function test() {

    var el =
document.getElementById('haufeindex').document.getElementById('result');
    alert(el);
}

</script>

<body>

    <iframe src="test1.html" width="100" height="50"  border="0"
            name="haufeindex" id="haufeindex"
            >
    </iframe>

<a href="javascript: test()">click me</a>

</body>
</html>


test1.html:
<html>
<body>
<div id="result" name="result">This sucks
</div>
</body>
</html>


Inside the Javascript methode I am trying to get the DIV 'result' from
test1.html. However this is not possible because 
document.getElementById('haufeindex').document is undefined. However this should
be defined

Reproducible: Always

Steps to Reproduce:
1.
2.
3.



Expected Results:  
Mozilla should return a reference to the DIV element.
(Reporter)

Comment 1

15 years ago
Created attachment 112855 [details]
main test.html
(Reporter)

Comment 2

15 years ago
Created attachment 112856 [details]
test1.html
> document.getElementById('haufeindex').document is undefined. However this should
> be defined

No, it should not.  document.getElementById('haufeindex').contentDocument should
be -- see http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-50708718
Status: UNCONFIRMED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → INVALID

Comment 4

15 years ago
vrfy invalid
Status: RESOLVED → VERIFIED

Updated

10 years ago
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.