views:

765

answers:

2

Can XMLHttpRequest send a request to http:// mydomain.com:81/ from http:// mydomain.com/ ?

+1  A: 

Requests are not send FROM some ports (in fact they are, but it is transparent), they are only send TO port.

Yes, you can send request to some port on machine you are at.

amorfis
+5  A: 

For two documents to be considered to have the same origin, the protocol (http/https), the domain and the port (the default 80 or :xx) have to be indentical. So no, you cannot use xhr against a different port.

Sean Kinsey
Note that IE6 under certain security settings lets you request a different port on the same domain.
Alsciende