Can XMLHttpRequest send a request to http://mydomain.example:81/
from http://mydomain.example/
?
Asked
Active
Viewed 3.0k times
124

Stephen Ostermiller
- 23,933
- 14
- 88
- 109
1 Answers
150
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
- 37,689
- 7
- 52
- 71
-
5Note that IE6 under certain security settings lets you request a different port on the same domain. – Alsciende Oct 13 '09 at 10:12