I am trying to send data to form site1 from site2 . But I get errors and the answer does not come back , what am I doing wrong? This is code ajax POST
$.ajax({
url: "site1/form.php",
crossDomain: true,
type: "POST",
data: {a: 'a1'},
contentType: "application/json; charset=utf-8;",
async: false,
dataType: 'jsonp',
success: function(data){
console.log('callback success');
console.log(data);
},
error: function(xhr, status, error) {
console.log(status + '; ' + error);
}
});
and this is form from site1
$a= $_POST['a']; echo $a;
What could be wrong? Titles on site1 in .htaccess I ordered ..