title: Cross Domain JSONP request returns Uncaught SyntaxError: Unexpected token :
body: <p>Hi I am trying to get a data from an API.</p>
  
  <p>I use an ajax call but then I always get an error message 
  Uncaught SyntaxError: Unexpected token :</p>
  
  <p>can anyone give me an example of how to do a correct jsonp call.</p>
  
  <p>below is my code snippet. I am using coffeescript</p>
  
  <pre><code>get_shipping:=&gt;
      shipper_id = @datapayload['general'][0]['shipper']
      origin = @datapayload['general'][0]['origin']
      destination = @datapayload['general'][0]['destination']
      if shipper_id == '001'
        expedition = 2
      if shipper_id == '002'
        expedition = 1
      if shipper_id == '003'
        expedition = 5
      if shipper_id == '004'
        expedition = 6
      api_code = 'my_api_code'
      @url = 'http://www.ongkoskirim.com/api/0.2/?id=' + api_code + '&amp;o=' + origin + '&amp;d=' + destination + '&amp;c=' + expedition + '&amp;callback=jsonhandler'
      $.getJSON @url, (data)=&gt;
        alert jsonhandler
      $.ajax(
        url:@url
        headers:{'Access-Control-Allow-Origin': '*'}
        crossDomain: 'true'
        type:'GET'
        dataType:'jsonp'
        jsonpCallback:'jsonhandler'
        success:(data)=&gt;
          console.log data
        error:=&gt;
          console.log "error"
      )
  </code></pre>
  
  <p>any help is appreciated. Thx</p>