[PHP] 原生js ajax提交 →→→→→进入此内容的聊天室

来自 , 2019-02-11, 写在 PHP, 查看 155 次.
URL http://www.code666.cn/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. }

回复 "原生js ajax提交"

这儿你可以回复上面这条便签

captcha