I understand that javascript disallows cross-domain scripting.

My (day-job) company has several domains, let's call them company.com and companysupport.com and companyusa.com and so forth.

A different group manages the main site. I created a small page of frequently-used links for different categories of products which I host on a server in my group, and they included these lists in the main site via an iframe. Some products have more links than others, and some not at all, so the length of the page iframe varies. Because of this, some pages look fine, others have a small gap between the links and the rest of the page, and others have a big gap (about 150px).

I found some javascript to automatically resize the iframe based on the length of the page, but obviously it did not work because the main site is on companyusa.com and mine was on companysupport.com. It gave an "Access Denied" error message but the script itself is OK because I was able to test it successfully when using it with an iframe pointing to the same server. I was able to get them to create a subdomain in companyusa.com and I pointed that as an alias towards my webserver.

I then found that the javascript still didn't work; the subdomains of the two servers were different but they were both in the same domain, let's say that the main page is on www.companyusa.com and with the iframe points to kb.companyusa.com. So does the entire domain, subdomain and all, have to match exactly in order to get javascript to work? Is there any way I can get this to work?