?
Solved

cannot write to another frame

Posted on 1998-03-28
3
Medium Priority
?
166 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 200 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Suggested Courses

770 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