PRB: Permission Denied Error Message When Scripting Across Frames (167796)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 4.0
- Microsoft Internet Explorer (Programming) 4.01
- Microsoft Internet Explorer (Programming) 5
- Microsoft Internet Client SDK 4.0
- Microsoft Internet Client SDK 4.01
This article was previously published under Q167796 SYMPTOMS
Script code that attempts to access a script or an object in a different frame may get the following script error message:
Permission denied: 'Parent.RemoteFrame.RemoteObject'
CAUSE
Internet Explorer 4.0 implements cross-frame security. A script or object
in one frame is not allowed to access scripts or objects in another frame
when the documents referenced by the SRC attribute of the frames specify Web
servers in different second-level domains. This corresponds to the "domain-
name.XXX" portion of the full server name syntax "server.domain-name.XXX".
The Internet Explorer 4.0 Dynamic HTML object model allows a certain subset
of safe actions to be scripted. For example, the window.location property
of a frame of the remote server can be set to allow navigation, but it cannot be
read to prevent one frame from snooping on the contents of another frame.
For example, it is valid for a document retrieved from
"http://test.microsoft.com" to manipulate another document retrieved from http://test.microsoft.com." It is not valid for a document retrieved from
"http://server1.some-domain-name.org" to manipulate a document located
retrieved from "http://server2" or "http://server3.microsoft.com."
The intention of cross-frame security is to prevent one Web page designer
from potentially misusing or snooping on the trusted objects authored by a
different Web page designer. Only those pages hosted in the same domain can
be trusted to safely script the contents of a particular page. This should
also prevent unwanted communication between documents on opposite sides of
a corporate firewall.
RESOLUTION
To prevent this error, documents that interact with each other must be
hosted by servers on the same domain.
To allow two documents hosted on the same second-level domain to interact,
both documents must set the document.domain property to their shared second-level domain. For example, one document on "http://example.microsoft.com"
could script and access another document on "http://test.microsoft.com" if
both documents used the following line of script code:
<SCRIPT LANGUAGE="VBScript">
document.domain = "microsoft.com"
</SCRIPT>
Under Internet Explorer 4, if the page with the cross-frame script resides
on a different server from the frameset source, the above script that sets
document.domain needs to be included in the framset source as well.
STATUSThis behavior is by design.REFERENCESFor more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:
- Dynamic HTML; DHTML Object Model; Cross-Frame
Scripting and Security
- RFC 1591: "Domain Name System Structure and Delegation"
- RFC 1034: "DOMAIN NAMES - CONCEPTS AND FACILITIES"
- Security & Cryptology; Networking protocols &
Data formats
Modification Type: | Major | Last Reviewed: | 5/11/2006 |
---|
Keywords: | kbFAQ kbprb kbScript KB167796 |
---|
|