473,480 Members | 2,347 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
5 6359
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6915
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7054
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
6993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4493
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3003
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
567
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.