title: where should i add response.addHeader?
body: <p>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".</p>
  
  <p>This is my ajax function.Now I can I get ajax response only from www.myspansalon.com..I want response from myspansalon.com.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;
  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&amp;format=raw&amp;task=myvoting",
         
      data: {item_id:itemid, user_id:userid, rating:rate }
      }).done(function(result){
       
   jQuery("#uservote").text(result);
      });
  }
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>