After implementing the Skyscanner Api to create a session, I received a 201 response indicating that the session was successfully created. However, my script encountered an exception which halted its execution: "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access". Below is the code snippet in question:
var apikey = "prtl6749387986743898559646983194";
var url = "http://partners.api.skyscanner.net/apiservices/pricing/v1.0/?apikey=" + apikey;
$.ajax({
type:"POST",
url:url,
dataType:"json",
crossDomain: true,
Accept:"application/json",
data:{
country:"UK",
currency:"GBP",
locale:"en-GB",
locationSchema:"iata",
apikey:"prtl6749387986743898559646983194",
grouppricing:"on",
originplace:"EDI",
destinationplace:"LHR",
outbounddate:"2016-05-29",
inbounddate:"2016-06-05",
adults:1,
children:0,
infants:0,
cabinclass:"Economy"
},
contentType:"application/x-www-form-urlencoded",
success:function(){
console.log("success");
}
});