Solved

cannot write to another frame

Posted on 1998-03-28
3
146 Views
Last Modified: 2012-05-04
I have a page with two frames; One frame - call it "A" - contains source
loaded from a CGI server. The other frame, "B", contains source
residing on the local machine.
I want A to use javascript to write to B, using document.write. Now sometimes, depending on which version
of Netscape I am using and which machine it is on,
this is ok. But sometimes it gives me an error like
"cannot access documents at <Local URL>" or something
like that.
Surely someone knows what is causing this? Am I doing
something conceptually bad, is there a better way to
accomplish this?

I will post more information about the problem if needed.

Thanks.
0
Comment
Question by:Rajuna
3 Comments
 

Expert Comment

by:crab1
ID: 1278919
Have you tried window.top.frame[B].document.write ? Or is that what you are having dificulty with?
0
 
LVL 3

Accepted Solution

by:
percyn earned 100 total points
ID: 1278920
This is a "security feature" addes to the 4th generation browsers. You need to set the "document.domain" property of both frames to a common URL.

Say that the CGI server is cgi.mydomain.com and the local webserver is www.mydomain.com. Then you need to set the document.domain to "mydomain.com" . Refer to Netscape's Javascript guide for more help.
0
 

Author Comment

by:Rajuna
ID: 1278921
This looks like it's on the right track. But there is just one snag still:
frame B is on a local machine, that is, a file: URL. when I examine
the document.domain property of this page, it is "" - the empty string.
Therefore I cannot possibly set it to a common domain as the
CGI server. What I want is for Netscape to recognize the hotname
of the local machine and let me set the domain as a part of that.
How???!!!

Please help, thanks in advance, I will give you the points for the answer
so far.

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now