title: get data from API CORS
body: <p>I'm trying to get a json data from a server that doesn't support CORS. I read the Jsonp is the solution for that kind of stituation but i still can't make it work  : 
  My code : </p>
  
  <pre><code> var headers = {
    'Authorization': 'Bearer ' + 'token',
    'Accept': 'application/json'
  };
  function myCallbackFunction(data){
              $('body').text(data.response);
          }
  $.ajax({
      type: "GET",
       headers : headers,
       url: "https://site/api/etc",
      dataType: "jsonp",
      success: function(data){console.log(data);},
      jsonp: false,
      jsonpCallback : "myCallbackFunction",
      error: function (xhr, ajaxOptions, thrownError) {
        alert(xhr.status);
        alert(thrownError);
      }
  });
  </code></pre>
  
  <p>i get this </p>
  
  <blockquote>
    <p>error: Uncaught SyntaxError: Unexpected token :</p>
  </blockquote>
  
  <p>i know that's because the server returns a json data but i don't know how to correct that because if change data type to json i get a CORS related error :</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="https://site/api/1.0/etc" rel="nofollow noreferrer">https://site/api/1.0/etc</a>. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://site" rel="nofollow noreferrer">http://site</a>' is therefore not allowed access.</p>
  </blockquote>
  
  <p>that means CORS not supported in the server side 
  but i use postman it works i don't understand.
  i've tried a lot of other thing but could get the data .
  Please help .
  Thank you.
  PS : i'm under a tomcat server</p>