What triggers cross-domain violation when AJAX request?

Due to this:

A resource is cross-origin when it's located at a different (sub)domain, protocol, or port!

You should also use exact match host so http://www.example.com/bar doesn't work out.

Take a look at this to see more examples.

You should not get CORS in the A option.

And also this article fully describing CORS.