Connecting Tech Pros Worldwide Forums | Help | Site Map

Same Origin Policy and domain aliases

Newbie
 
Join Date: May 2007
Posts: 2
#1: May 15 '07
Hello all,
Please forgive me if this is a simple question - I'm new. I'm using Javascript to create an XmlHttpRequest object to allow client pages to call PHP scripts on a server. IPs in the form www.myserver.com and http://11.111.111.11 work as expected but an alias in the form alias.myserver.com causes an http request made to the server to be denied with the error message "permission denied". I've tried passing the alias in the URL of the http request call, modifying the chmod values for the files and directories involved with no success. The alias appears to be correct in that I see the page I expect to see - http requests just won't work. Does anyone have any suggestions? Thanks!

acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: May 16 '07

re: Same Origin Policy and domain aliases


Welcome to TSDN.

I can give you one possible suggestion. For the page that you are trying to access give the full address (including the http). See if that works.
Newbie
 
Join Date: May 2007
Posts: 2
#3: May 16 '07

re: Same Origin Policy and domain aliases


Quote:

Originally Posted by acoder

Welcome to TSDN.

I can give you one possible suggestion. For the page that you are trying to access give the full address (including the http). See if that works.

I'm guessing you mean passing the full address in the url aparam of the XmlHttpRequest. I tried that, but it didn't work. After researching, my understanding is that javascript included in an html file is interpreted as being from the same domain as said html. The function that creates my XmlHttpRequest object is in a javascript file included in the html that is sent to the client. To my understanding this should negate any cross domain issues, but yet it doesn't seem to.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: May 17 '07

re: Same Origin Policy and domain aliases


Where is the javascript file located?
Reply