Are different ports on the same server considered cross-domain? (Ajax-wise)

Sause picture Sause · Jul 3, 2009 · Viewed 26.1k times · Source

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

Answer

Sean Kinsey picture Sean Kinsey · Jul 5, 2009

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.