Solved

cannot write to another frame

Posted on 1998-03-28
3
157 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

820 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