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

AjaxCross Domain

Ajax Problem Overview


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

Ajax Solutions


Solution 1 - Ajax

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSauseView Question on Stackoverflow
Solution 1 - AjaxSean KinseyView Answer on Stackoverflow