By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,481 Members | 1,713 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,481 IT Pros & Developers. It's quick & easy.

JavaScript error (Opera, Netscape) - calling function from different frame

P: n/a
Hi, folks.
Does this error below look familiar to you? I'm trying to access
function in one frame from the other frame. Error is received while
working with Opera or Netscape (different errors). No problems are
encountered with Microsoft IE - everything works fine. Any ideas about
direction?
// Opera error

Inline script thread
Error:
name: ReferenceError
message: Security error: attempted to read protected variable
Javascript URL thread:
"javascript:top.frames.code.menuItemSelect(13) ;"
Error:
name: Error
message: Security violation

// Netscape error

Error: top.frames.code.docMenu has no properties
Source File: http://localhost/web/Test/JavaScript...eTextColor.htm
Line: 60

Thanks,
Dan Tartakovsky
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
In article <74**************************@posting.google.com >,
da******@yahoo.com enlightened us with...
\

Error: top.frames.code.docMenu has no properties


Try using
top.frames["frameName"].document.code.docMenu

where frameName is the name given to the frame in the frameset.
I also assume code is a property of document (since you posted no code,
I have no idea what it is). If it is a property of the window object,
remove "document" from the above.
top.frames["frameName"].code.docMenu

Other than that, I'd have to see the javascript code, as well as the
html, to be able to say anything else, so I could see what objects were
what.

Sometimes it helps to get a free Geoshitties or Angelfire account and
upload relevant code (just enough to show the problem) so we can bring
it up in our browsers and see everything.

--
~kaeli~
A chicken crossing the road is poultry in motion.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2

P: n/a
Hi.
to simplify the problem: I have 2 frames - "code" and "main".

In the "code" one I've defined function myFunction:

<head>
<script>
function aa(b) {
this.LINE=b;
}
var bb = new aa(true);
</script>
</head>

In the "main" frame I do following:

<html>
<head>
<script>
function onCall() {
alert("Value is : " + top.frames.code.bb.LINE);
}
</script>
</head>
<body>
<input type="button" onClick="onCall();" value="Click" />
<body>
It works excellent in IE, but not Netscape.

Error I get in Netscape is:
-------------------------------------------
Error: top.frames.code.bb has no properties
Source File: http://localhost/web/Test/JavaScript/Menu/docs/main.htm
Line: 5
------------

And by the way, changing top.frames.code.bb.LINE to
top.frames["code"].bb.LINE or top.frames["code"].document.bb.LINE does
not help.

Any ideas?

Thanks,
Dan
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

P: n/a
Lee
Dan Tartakovsky said:

Hi.
to simplify the problem: I have 2 frames - "code" and "main".

In the "code" one I've defined function myFunction:

<head>
<script>
function aa(b) {
this.LINE=b;
}
var bb = new aa(true);
</script>
</head>

In the "main" frame I do following:

<html>
<head>
<script>
function onCall() {
alert("Value is : " + top.frames.code.bb.LINE);
}
</script>
</head>
<body>
<input type="button" onClick="onCall();" value="Click" />
<body>
It works excellent in IE, but not Netscape.

Error I get in Netscape is:
-------------------------------------------
Error: top.frames.code.bb has no properties
Source File: http://localhost/web/Test/JavaScript/Menu/docs/main.htm
Line: 5
------------

And by the way, changing top.frames.code.bb.LINE to
top.frames["code"].bb.LINE or top.frames["code"].document.bb.LINE does
not help.

Any ideas?


It works fine for me in Netscape 7, even with the typo in the
closing </body>. You've probably got a syntax error in your
frameset page that IE is forgiving, but Netscape won't allow.

Jul 20 '05 #4

P: n/a
In article <3f***********************@news.frii.net>, da******@yahoo.com
enlightened us with...

It works excellent in IE, but not Netscape.


Which Netscape? Including version. 7.0 is a little buggy, as is 6.0 and
some versions of 4. I don't think 4 supports the new object creation
either.
Also, is this on Mac or Win or Unix?

Tested in NN7.1 on Win, it worked fine.

--
--
~kaeli~
It was recently discovered that research causes cancer in
rats.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #5

P: n/a
kaeli <ti******@NOSPAM.comcast.net> wrote in message news:<MP************************@nntp.lucent.com>. ..
In article <3f***********************@news.frii.net>, da******@yahoo.com
enlightened us with...

It works excellent in IE, but not Netscape.


Which Netscape? Including version. 7.0 is a little buggy, as is 6.0 and
some versions of 4. I don't think 4 supports the new object creation
either.
Also, is this on Mac or Win or Unix?

Tested in NN7.1 on Win, it worked fine.

--


I have exactly the same problem in Opera (7.11 - build 2887) with the classic:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="Javascript">
function blank() { return "<HTML>default text</HTML>" }
</SCRIPT>
</HEAD>

<FRAMESET ROWS="5%, *>
<FRAME NAME="f1" SRC="javascript:parent.blank()">
<FRAME NAME="f2" SRC="javascript:parent.blank()">
</FRAMESET>

</HTML>
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.