Access-Control-Allow-Origin html code example
Example 1: access-control-allow-origin
Access-Control-Allow-Origin: *
Example 2: javascript cors error
$.ajax({
headers: { "Accept": "application/json"},
type: 'GET',
url: 'http://cl.ly/2wr4',
crossDomain: true,
beforeSend: function(xhr){
xhr.withCredentials = true;
},
success: function(data, textStatus, request){
console.log(data);
}
});