title: What triggers cross-domain violation when AJAX request?
body: <p>I was asked a question below and cannot find the answer. I looked up similar posts, but many posts (like <a href="https://stackoverflow.com/questions/298745/how-do-i-send-a-cross-domain-post-request-via-javascript">this</a>) ended up talking about cross-origin, not cross-domain. What is the answer to the below question?</p>
  <p>Q: Assume you are working on a webpage at <a href="http://example.com/path/to/foo.html" rel="nofollow noreferrer">http://example.com/path/to/foo.html</a>.
  if you were to send an AJAX request to the following URLs, which one would NOT trigger a cross-domain violation?</p>
  <p>A: <code>http://example.com/bar</code></p>
  <p>B: <code>https://example.com/path/to/bar.html</code></p>
  <p>C: <code>https://example.com:80/bar</code></p>
  <p>D: <code>http://www.example.com/bar</code></p>
  <p>E: <code>C and D</code></p>
  <p>Thank you in advance.</p>
  <p>UPDATE:
  Originally, I came across a website saying <code>there is a 'Cross-domain violation' which is different from 'CORS' since 'origin' and 'domain' points different part.</code> That's why I have been looking for the definition of <code>'cross-domain violation'</code>. But it was actually the same as 'same-origin policy', as the answer below shows.</p>