0

I am trying to access a different web content and get the contents from the web content to another web. i get above title error all the time in my jquery request.

here is my code

 $.ajax({
 url: 'destinationURL',
 type: "POST", //This is what you should chage
 dataType: "application/json; charset=utf-8",
 username: "FAA/uttam ctr dhakal", // Most SAP web services require credentials
 password: "MEETfamily2018",
 processData: false,
 contentType: "application/json",
 headers: {"Access-Control-Allow-Origin" : "(TRIED WITH Destination/Source 
 Both URLs)",
  },
 success: function () {
     alert("success");
 },
  error: function (xhr, ajaxOptions, thrownError) { //Add these parameters to 
  display the required response
     alert(xhr.status);
     alert(xhr.responseText);
 },
});
user388969
  • 337
  • 1
  • 9
  • 30

1 Answers1

0

That happens when the destination has no 'Access-Control-Allow-Origin' set on response headers allowing you web site or * for any web site.

Rafael Quintela
  • 1,908
  • 2
  • 12
  • 14