Quantcast
Channel: WampServer - WampServer English
Viewing all articles
Browse latest Browse all 3177

Unable to get response on ajax call (1 reply)

$
0
0
I have tried to execute a code

function showHint(str) {
  var xhttp;
  if (str.length == 0) { 
    document.getElementById("IDD").innerHTML = "";
    return;
  }
  xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      document.getElementById("IDD").innerHTML = this.responseText;
    }
  };
  xhttp.open("GET", "xxxxx.php?q="+str, true);
  xhttp.send();   
}

xxxxx.php

<?php

$str=$_GET('str');
echo  $str;

?>

Viewing all articles
Browse latest Browse all 3177

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>