Make an ajax call to webservice url on visualforce page using javascript
<p>In salesforce, on hitting a button I need to call a web service url through an ajax call.</p>

<p>Please check my code below : </p>

<pre><code>    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) {
          var response = xmlhttp.responseText; 
                      }
                    } 
     var requrl ='my webservice url';
                       alert(requrl);
                       xmlhttp.open("POST",requrl);
                       xmlhttp.send();
</code></pre>

<p>When I hit this 'requrl' manually on browser, it works fine.
Can anyone tell me what I am doing wrong above or provide me a sample code against this?</p>