Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: SV: RE: SV: document.domain


Message #1 by "Robert Nyman" <robert.nyman@c...> on Thu, 31 Oct 2002 20:47:40 +0100
I'll copy and paste it into this e-mail, I hope it helps (probably not,
you seem
to know enough, so this info won't help).

Here it comes, anyway:

domain Property

Sets or retrieves the security domain of the document.

Syntax

document.domain [ =3D sDomain ]

Possible Values

    sDomain String that specifies or receives the domain suffix.

    The property is read/write. The property has no default value.

    Expressions can be used in place of the preceding value(s), as of
Microsoft=AE Internet Explorer 5. For more information, see About 
Dynamic
Properties.

Remarks

    The property initially returns the host name of the server from
which the page is served. The property can be assigned the domain suffix
to allow sharing of pages across frames. For example, a page in one
frame from home.microsoft.com and a page from www.microsoft.com
initially would not be able to communicate with each other. However, by
setting the domain property of both pages to the suffix "microsoft.com",
you ensure that both pages are considered secure and access is available
between the pages.

    When you set the domain property, use the domain name determined by
the server rather than by the client browser.

    All the pages on different hosts must have the domain property
explicitly set to the same value to communicate successfully with each
other. For example, the value of the domain property of a page on the
host microsoft.com would be "microsoft.com" by default. It might seem
logical that if you set the domain property of a page on another host
named msdn.microsoft.com to "microsoft.com," that the two pages could
communicate with each other. However, this is not the case unless you
have also explicitly set the domain property of the page on
microsoft.com to "microsoft.com".

    Furthermore, this property cannot be used to allow cross-frame
communication among frames with different domain suffixes. For example,
a page in one frame from www.microsoft.com and a page in another frame
from www.msn.com would not be able to communicate with each other even
if the domain property of both pages was set to the suffix
"microsoft.com".
    security note Security Alert  Using this property incorrectly can
compromise the security of your Web site. Set the domain property only
if you must allow cross-domain scripting. Use a value determined on the
server. Setting this property to a value determined on the client (like
through the location object) could expose your site to attack from
another site through Domain Name System (DNS) manipulation. For more
information, see Security Considerations: Dynamic HTML.


Standards Information

    This property is defined in World Wide Web Consortium (W3C) Document
Object Model (DOM) Level 1

Applies To

    document


/Robert


-----Ursprungligt meddelande-----
Fr=E5n: Mike Rittelmeyer [mailto:mike.rittelmeyer@d...]
Skickat: den 31 oktober 2002 19:05
Till: javascript
=C4mne: [javascript] RE: SV: document.domain


Thanks Robert. Unfortunately, I am not "authorized" to view that link.

Mike

-----Original Message-----
From: Robert Nyman [mailto:robert.nyman@c...]
Sent: Thursday, October 31, 2002 9:32 AM
To: javascript
Subject: [javascript] SV: document.domain


I don't know why the problem occurs, but this link might give you some
clues:

http://msdn.microsoft.com/library/default.asp?url=3D/workshop/author/dhtm
l
/reference/dhtml_reference_entry.asp


/Robert


-----Ursprungligt meddelande-----
Fr=E5n: Mike Rittelmeyer [mailto:mike.rittelmeyer@d...]
Skickat: den 31 oktober 2002 14:28
Till: javascript
=C4mne: [javascript] document.domain


I am getting an "Access is denied." javascript error when using
document.domain=3D in the following context. Does
document.domain=3D"newdomain.com" need to be the FIRST line?

<html>
<head>
<title>Amtrak</title>
<script type=3D"text/javascript" language=3D"JavaScript"
src=3D"/std/utils.js"></script>
<script type=3D"text/javascript" language=3D"JavaScript"
src=3D"/std/ibeMain.js"></script>
<script type=3D"text/javascript"
language=3D"JavaScript">document.domain=3D"newdomain.com";</script>

</head>

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
************************************************************************
****
*******
This electronic transmission is strictly confidential and intended
solely for the addressee. It may contain information which is covered by
legal, professional or other privilege. If you are not the intended
addressee, you must not disclose, copy or take any action in reliance of
this transmission. If you have received this transmission in error,
please notify the sender as soon as possible.

This footnote also confirms that this message has been swept for
computer viruses.
************************************************************************
****
********



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20


  Return to Index