Native JS Ajax submission

From , 5 Years ago, written in PHP, viewed 96 times.
URL https://pastebin.vip/view/6c4bb406
  1. function send(str) {
  2.     if (str == "") {
  3.         document.getElementById("txtHint").innerHTML = "";
  4.         return;
  5.     }
  6.     if (window.XMLHttpRequest) {
  7.         // code for IE7+, Firefox, Chrome, Opera, Safari
  8.         xmlhttp = new XMLHttpRequest();
  9.     } else {
  10.         // code for IE6, IE5
  11.         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  12.     }
  13.     xmlhttp.onreadystatechange = function() {
  14.         if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  15.             document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
  16.         }
  17.     }
  18.     xmlhttp.open("GET", "getcd.php?q=" + str, true);
  19.     xmlhttp.send();
  20. }

Reply to "Native JS Ajax submission"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website