120

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

John Topley
  • 110,534
  • 45
  • 192
  • 237

1 Answers1

145

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
  • 36,831
  • 7
  • 50
  • 70