Search code examples
javascriptajaxxmlhttprequest

Cross origin request domain to subdomain


I am trying to send xhttp request in javascript. My both domain and subdomain are https secured. Applied allowed Access-Control-Allow-Origin: * / example.com header as true but still i am getting. Tried jquery ajax as well javascript xml http request. For example domain name like as example.com, blog.another.com, Subdomain is of different domain.


Solution

  • This is most common error , Even after implement as given solutions , But i would suggest send request with credential parameter.

    try it xhttp.withCredentials = true;

    Hope it will work if you already tried Access-Control-Allow-Origin: *