473,725 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
+ 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.me nuItemSelect(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 6376
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.LI NE 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.LI NE 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************ ***********@new s.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******@NOSPA M.comcast.net> wrote in message news:<MP******* *************** **@nntp.lucent. com>...
In article <3f************ ***********@new s.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="Javas cript">
function blank() { return "<HTML>defa ult 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
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9113
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6011
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3221
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 we have to send another system
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.