Unable to get response on ajax call
Posted by: TejuKolli (117.198.149.---)
Date: March 01, 2021 12:08PM

I have tried to execute a code

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

xxxxx.php

<?php

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

?>



Edited 3 time(s). Last edit at 03/01/2021 01:36PM by RiggsFolly.

Re: Unable to get response on ajax call
Posted by: RiggsFolly (Moderator)
Date: March 01, 2021 01:35PM

Hi,

Good for you, well done!

Note, this is a WAMPServer help forum, to provide people assistance getting WAMPServer up and running properly.

It is not a PHP nor Javascript training centre

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Sorry, only registered users may post in this forum.