title: Why Asynchronous Javascript Get Request No Response?
body: <p>i'm having problem to use HTTP.Get request on Javascript,
  here is my code</p>
  
  <pre><code>function getData(url, callback) {
          var xhttp = new XMLHttpRequest();
          xhttp.onreadystatechange = function() {
              if (this.readyState == 4 &amp;&amp; this.status == 200) {
                  callback(this.responseText);
              }
          };
  
          xhttp.open("GET", url, true);
          xhttp.send();
      }
  }
  </code></pre>
  
  <p>why no response when i call it</p>
  
  <pre><code>getData("http://www.example.com/data.php",   function(data) {            
       console.log(data);
  });
  </code></pre>
  
  <p>Can you please help me? any hint would be very helpful</p>