Where should i add this function response.addHeader("Access-Control-Allow-Origin", "*"); to avoid the error "No 'Access-Control-Allow-Origin' header is present on the requested resource".
This is my ajax function.Now I can I get ajax response only from www.myspansalon.com..I want response from myspansalon.com.
<script>
function getdetails(rate){
var itemid=jQuery("#itemid").val();
var userid=jQuery("#userid").val();
jQuery("#clear").show();
jQuery("#uservote").text('loading...');
jQuery.ajax({
type: "POST",
url:"http://www.myspansalon.com/joomla/index.php?option=com_flexicontent&format=raw&task=myvoting",
data: {item_id:itemid, user_id:userid, rating:rate }
}).done(function(result){
jQuery("#uservote").text(result);
});
}
</script>