title: Coding with XMLHttpRequest for Safari Extension
body: <p>In my extension, I create Access Level as "All" as well as I add whitelists as <code>http://*/*</code> too for every domain.</p>
  
  <p>And I have following code in my JS file (which run as end script):</p>
  
  <pre><code>var feedbackmsg = "message goes here";  
  var xmlhttp = new XMLHttpRequest();
  
  xmlhttp.open('POST', 'http://mysitename.com/feedback.php', true);
  xmlhttp.onreadystatechange = handleServerResponse;
  xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  xmlhttp.send("html=" + feedbackmsg);
  
  function handleServerResponse() {    
      if (xmlhttp.readyState == 4) {
          alert(xmlhttp.getAllResponseHeaders());
          if (xmlhttp.status == 200) {
              alert("send");
          } else {
              alert("error");
          }
      } 
  }
  </code></pre>
  
  <p>Whenever I run it, I am getting no header respond in alert box as well as error alert message. How can I resolve the problem?</p>