AJAX Problem - Access is Denied

Hi Guys

I have this code in my page, but I keep getting Access Is Denied Javascript error when i try to load the page in different sub-domains in our server network(sub1.mydomain.com, sub2.mydomain.com), but works fine on the main domain (www.mydomain.com)

They can go straight to the subdomain, because it is in the DNS of our internal network that way. To alleviate this issue, I was trying to write a script, that would loop through the different ones, catching the error and then trying the next one, until it found one that worked or ran out of options. My script looked something like this:

This might not be of much help but just felt like sharing this ... You can enable cross-domain on IE by going into Internet Options -> Security Settings ->Custom level and enabling "Access data sources across domains".

You should not set such restrictions on users in order for them to use your webpage, that is just bad practice. If a solution cannot be figured out to a problem without restricting the user, then the problem should be rethought because something must have gotten missed somewhere.

I probably should have told what my solution was, just didn't realize I never posted it. What I ended up doing was, getting the URL of the page being accessed. I used window.location.href and parsed this to give me the first part of the URL. Once I had the first part of the url, I then appended it to the ajax URL so that I did not have any cross domain issues. This was the best solution I could come up with for my problem. The users didn't have any restrictions set on them (well, except the use of javascript, but if they aren't using that, then they most likely aren't able to use a lot of sites out there).