Solved

cannot write to another frame

Posted on 1998-03-28
3
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

691 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