Skip to content

Javascript across windows: same domain, different server

February 8, 2007

Because of the Javascript “download and go” execution model security is a big deal and there are numerous restrictions put in place when you try to access the DOM of another page.

But there are many situations where it is useful to be able to communicate information or DOM values between windows that happen to reside on different servers. This is allowed as long as the pages reside in the same <strong>domain</strong>.

The browser has limited information and isn’t smart enough to know that <em>serverA</em> and <em>serverB</em> are in the same domain. You must use a fully qualified name such as <em></em> and <em></em>. However, this is still not enough for IE. In each page you must set the <em>document.domain</em> property to <em> (a suffix).</em> Only then will your scripts work.

<a target=”_blank” href=”; mce_href=””>MSDN: domain property</a>

<a target=”_blank” href=”; mce_href=””>MSDN: About Cross-Frame Scripting and Security</a>

<a href=””>The Same Origin Policy</a>


From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: