Closed Bug 92557 Opened 23 years ago Closed 23 years ago

Cannot get frame document object from javascript

Categories

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

x86
Windows NT
defect
Not set
major

Tracking

()

VERIFIED DUPLICATE of bug 22681

People

(Reporter: vicentesalvador, Assigned: pollmann)

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.2+)
Gecko/20010724
BuildID:    2001072403

Getting from javascript frame document when the frameset has breen created by
javascript file returns null and not the document object.

This works on June nightly builds but I cannot determine when this has been broken

Reproducible: Always
Steps to Reproduce:
Ejecute the sample code atached

Actual Results:  Returns null

Expected Results:  The alert should show the document object and not null

<!-- test.html -->

<html>
<head>
<script TYPE='text/javascript' LANGUAGE='javascript1.2' SRC='jtab0.js'></SCRIPT>
</head>
<script TYPE='text/javascript' LANGUAGE='javascript1.2'>
BuildFrame()
</SCRIPT>
</html>

<!-- frame1.html -->

<html>
<head>
	<script>
		alert(parent.frames["HEAD"].document);	// This returns null
	</script>
</head>
<body>
	hello world!!!
</body>
</html>

<!-- jtab0.js -->

function BuildFrame()
{
	document.writeln("<FRAMESET ROWS='315,*' BORDER='0' MARGINHEIGHT=0 MARGINWIDTH=0
BORDERCOLOR='#FFFFFF'>");
	document.writeln(" <FRAME SRC='javascript:\"<BODY BGCOLOR=#FFFFFF></BODY>\"'
NAME='HEAD'>");
	document.writeln("  <FRAMESET COLS='50,*' BORDER='0' MARGINHEIGHT=1 MARGINWIDTH=1
BORDERCOLOR='#CCCCCC'>");
	document.writeln("   <FRAME SRC='frame1.html' NAME='LEFT'>");
	document.writeln("   <FRAME SRC='javascript:\"<BODY BGCOLOR=#FFFFFF></BODY>\"'
NAME='RIGHT'>");
	document.writeln(" </FRAMESET>");
	document.writeln("</FRAMESET>");
}
Eric, here's one more frame-doesn't-synhronously-load-a-document-on-construction
bug :-)
Assignee: jst → pollmann
Status: UNCONFIRMED → NEW
Ever confirmed: true
confirmed ..is printing null
dup of bug 88291 and also bug 61468, maybe others. We need to decide which bug
to keep as the good one.
bug 22681 seems to be the right dup
Marking as dup of bug 22681. Please reopen if you don't agree, thanks!

*** This bug has been marked as a duplicate of 22681 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Maybe I'm missing something, but I think bug 22681 is about iframes, not frames.
Frames and iframes are the same thing in mozilla, if there's a problem with one
the problem most likely exists in the other.
Ok.
verified as dup
Status: RESOLVED → VERIFIED
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.