[Javascript] Ajax & proxy question
Scott Reynen
scott at randomchaos.com
Fri Jan 12 11:21:26 CST 2007
On Jan 12, 2007, at 10:42 AM, Matt Murphy wrote:
> our company has a proxy server. Whenever I use an ajax script to
> request something from the server, if it's going through the proxy
> it fails. I'm trying to figure out if the HTTPRequest method is a
> standard port 80 HTTP request to the server? and back? It seems
> like it is, and therefore should work through the proxy just fine.
>
> Any clues as to what's going on?
>
> If my ajax function does all the screen updating on the client
> side, and just sends stuff back to the server to update the db, no
> problem. But if I need to eval some code back from the server, no
> luck.
You can't do cross-domain AJAX. XMLHttpRequests can only be made to
the domain (and subdomain and port) initiating the request. So if
your AJAX request is going through a proxy, your HTML page making the
request needs to be loading through the same proxy.
Peace,
Scott
More information about the Javascript
mailing list