Rahul Rahul - 1 year ago 99
Ajax Question

how do I get the reponse text from ajax code

I have one url like "".when i run this url i am getting "Hi welcome".how to write code in AJAX to get "Hi welcome"

Answer Source

You should've searched it a bit more. In this Link you have the easy GET method, that will look like this:

function loadDoc() {
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (xhttp.readyState == 4 && xhttp.status == 200) {
     document.getElementById("demo").innerHTML = xhttp.responseText;
  xhttp.open("GET", "", true);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download