title: Getting Cross Origin Error While Calling API From Jquery AJAX
body: <p>I Got Following Error While Calling API From AJAX Jquery.</p>
  
  <blockquote>
    <p>Access to XMLHttpRequest at
    '<a href="https://www.demo.in/rest/employee/mapping/v3/9714620362" rel="nofollow noreferrer">https://www.demo.in/rest/employee/mapping/v3/9714620362</a>' from origin
    '<a href="http://localhost:8191" rel="nofollow noreferrer">http://localhost:8191</a>' has been blocked by CORS policy: Response to
    preflight request doesn't pass access control check: No
    'Access-Control-Allow-Origin' header is present on the requested
    resource</p>
  </blockquote>
  
  <p>I don't have Access To Change API Coding. I just have API call  From javascript or Jquery.
  I used Following Code For Calling  REST API.But I is not Working.</p>
  
  <pre><code>$.ajax({
          url: 'https://www.demo.in/rest/employee/mapping/v3/9714620362',
          headers: {
              'Access-Control-Allow-Origin': '*',
              'Content-Type':'application/json'
          },
          method: 'GET',
          dataType: 'json',
          data: '',
          success: function(data){
            console.log('succes: '+data);
          }
        });
  </code></pre>