I am sending a data through POST with ajax, but it never sends since I get that error "Access-Control-Allow-Origin" and I could not solve it, this is the code:
$.ajax({
/*url: 'https://webto.salesforce.com/servlet/servlet.WebToLead',*/
url: 'https://webto.salesforce.com/servlet/servlet.WebToLead',
type: "POST",
headers: {'Access-Control-Allow-Origin': 'https://webto.salesforce.com/servlet/servlet.WebToLead'},
beforeSend: function (request) {
request.setRequestHeader("Authorization", "Negotiate");
},
crossOrigin: true,
crossDomain: true,
data: {
'first_name':datos[0] ,
'last_name': datos[1],
'email': datos[2] ,
'mobile': datos[3] ,
'00N1I00000GF3OD':datos[4] ,
'country': datos[5] ,
'oid' : "00D1I000002KTso",
'retURL' : "",
'lead_source' : "Pagina Web",
'recordType' : "0121I000000VktK"
},
success: function() {
alert('termino1');
}
});
and I do not know what else to do '