IE Frameset OnLoad "Object doesn't support this property or method" error

M

mygoogleac

Folks,

Take a look at the sample code below and let me know if you can figure
out why I'm getting an "Object doesn't support this property or
method" error for the "frame2.DisplayForm()" only after selecting the
Refresh icon in IE. In other words, it loads and performs fine on the
initial load. I'm thinking this is a timing issue but my understanding
is the "OnLoad" option to the Frameset will only run AFTER the frames
are load. Thanks in advance for any help.

SLS

----FrameSet.html--------------------------

<HTML>
<HEAD>
<TITLE>Frame Set Demo</TITLE>
</HEAD>
<FRAMESET ROWS="10%,90%" FRAMEBORDER=1
OnLoad="frame2.DisplayForm()">
<FRAME src="Frame1.html" NAME="frame1">
<FRAME src="Frame2.html" NAME="frame2">
</FRAMESET>
</HTML>



----Frame1.html--------------------------

<HTML>
<HEAD>
<SCRIPT LANGUAGE='JavaScript'>
function foo(){
alert("foo()")
}
</SCRIPT>
</HEAD>

<BODY>
</BODY>
</HTML>



----Frame2.html--------------------------
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function DisplayForm(){
document.writeln("<FORM>")
document.writeln("<SELECT SIZE=3>")
document.writeln(" <OPTION>foo")
document.writeln(" <OPTION>bar")
document.writeln(" <OPTION>baz")
document.writeln("</SELECT>")
document.writeln("</FORM>")
document.close()
}

</SCRIPT>
</HEAD>

<BODY>
</BODY>
</HTML>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,231
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top