title: Set referer for XMLHttpRequest?
body: <p>I am successfully sending a <code>XMLHttpRequest</code> by using:</p>
  <pre><code>var createCORSRequest = function(method, url) {
    var xhr = new XMLHttpRequest();
    if (&quot;withCredentials&quot; in xhr) {
      // Most browsers.
      xhr.open(method, url, true);
    } else if (typeof XDomainRequest != &quot;undefined&quot;) {
      // IE8 &amp; IE9
      xhr = new XDomainRequest();
      xhr.open(method, url);
    } else {
      // CORS not supported.
      xhr = null;
    }
    return xhr;
  };
  
  var url = 'http://www.whatismyip.com';
  var method = 'GET';
  var xhr = createCORSRequest(method, url);
  
  xhr.onload = function() {
    // Success code goes here.
  };
  
  xhr.onerror = function() {
    // Error code goes here.
  };
  
  
  xhr.setRequestHeader('referer', 'http://www.google.com');
  xhr.send();
  </code></pre>
  <p>However, I could not able to define my <code>referer</code>. What is the correct way to add the custom <code>referer</code>?</p>