Friday, February 23, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  3] [ 3]  / answers: 1 / hits: 16364  / 15 Years ago, mon, april 13, 2009, 12:00:00

The Same Origin Policy Documentation says this:




There is one exception to the same
origin rule. A script can set the
value of document.domain to a suffix
of the current domain. If it does so,
the shorter domain is used for
subsequent origin checks. For example,
assume a script in the document at
http://store.company.com/dir/other.html
executes the following statement:



document.domain = company.com;



After
that statement executes, the page
would pass the origin check with
http://company.com/dir/page.html.
However, by the same reasoning,
company.com could not set
document.domain to othercompany.com.




Do all popular browsers support this? If not, which ones don't?


More From » browser

 Answers
9

Firefox 2,3, IE6,7,8, Chrome, and Safari 2 and 3, Opera 9 all support document.domain;



Other newer browsers likely will as well, however those are the ones that I've actually tested my code (which makes use of document.domain)


[#99712] Monday, April 6, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
carlton

Total Points: 373
Total Questions: 123
Total Answers: 97

Location: Saint Helena
Member since Wed, Nov 9, 2022
1 Year ago
carlton questions
Sun, Apr 25, 21, 00:00, 3 Years ago
Wed, Feb 17, 21, 00:00, 3 Years ago
Tue, Oct 27, 20, 00:00, 3 Years ago
Tue, Oct 13, 20, 00:00, 3 Years ago
Mon, Apr 13, 20, 00:00, 4 Years ago
;