I have to set the cookie value on the button click. The return value is just a success/failure message. I am using php for set cookie. I am using jquery ajax() for making request. but when i click on the button nothing is happening and i am getting an error message as "No 'Access-Control-Allow-Origin' header is present on the requested" in the error console.
The following is my ajax call,
$('#visitors').click(function(){
$.ajax({
type:'POST',
url:'http://site_url/setCoocky.php?action=SET_COOCKIE&user=visitor',
crossDomain: true,
headers: { 'Access-Control-Allow-Origin': '*' },
/* beforeSend: function (request) {
//request.setRequestHeader("Access-Control-Allow-Origin: ", "*")
},*/
success:function(resp){
window.location.href = site_url+"#!/pageHome";
}
});
});
please help me..
Thanks& regards, johncy binoy