Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.domain

Status
Not open for further replies.

sweevo

Programmer
Jan 30, 2002
182
0
0
GB
Hello

I am trying to define the document.domain value in two pages so some javascript can interact two pages on different servers (at the moment I can't host them on the same one). Page 1 is on, say, sub1.domain.com, and can be loaded in the browser by just typing "sub1" (so its document.domain value is "sub1").

I have a DNS and relevant host headers set up for the second server, for example, sub2.sub1.domain.com. If I load this by typing "sub2.sub1" in the browser, that page's domain is immediately different from the other page, so any interaction between the pages obviously hits the "Access Denied" problem.

So, I try to reset the domain on page two: document.domain = 'sub1' but get an "Invalid argument" error.

I know you can set a "sub.domain.com" to just "domain.com", so is it not possible to set "sub2.sub1" to "sub1"?

Hope that makes sense. Any help would be appreciated.

Thanks.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top