Help - Search - Members - Calendar
Full Version: Why my frame does not work on Safari 3.0.4?
HTMLHelp Forums > Programming > Client-side Scripting
joecool2005
Hi,

I want to build a simple frame.
The following code works fine on IE6 and IE7 but doesn't work on Safari 3.0.4.
It showed me this error message on Safari 3.0.4.
QUOTE
"TypeError: Value undefined (result of expression top.frames["toolbar"].doSomething2) is not object."

Why?

Plz help
Thx
Joe

default.htm
CODE

<frameset id="frameset1" rows="119,*" name="frameset1" border="0" frameSpacing="0" frameBorder="no">
        <frame name="toolbar" id="toolbar" src="button.htm" marginheight="0" marginwidth="0" scrolling="no" NORESIZE>
        <frame name="top_main" id="top_main" src="button2.htm" marginheight="0" marginwidth="0" NORESIZE>
    </frameset>


button.htm
CODE

<html>

<head>
<script language="JavaScript">
function doSomething2(){
  alert("this is my document");
}
</script>
</head>
<body>
my page
</body>

</html>


button2.htm
CODE

<HTML>
<script language="JavaScript">
try{

top.frames["toolbar"].doSomething2()
}
catch(e){alert(e);}
</script>
<body>
button2<br />
</body>
</HTML>
pandy
QUOTE(joecool2005 @ Feb 5 2008, 07:49 PM) *

The following code works fine on IE6 and IE7 but doesn't work on Safari 3.0.4.
It showed me this error message on Safari 3.0.4.
QUOTE
"TypeError: Value undefined (result of expression top.frames["toolbar"].doSomething2) is not object."

Why?


That is a JavaScript error. Maybe the page it tries to do something with isn't fully loaded when the script fires.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.