All pastes #85884 Raw Edit

Something

public text v1 · immutable
·published 2006-07-12 07:23 UTC
rendered paste body
<script language="javascript"  type="text/javascript">
var url = "./xmlhttp.php?param="; // The server-side script
function updateElements(elementId, updateElementId) {
  var elementvalue = document.getElementById(elementId).value;
  http.onreadystatechange = handleHttpResponse(updateElementId);
  http.open("GET", url + escape(elementvalue), true);
  http.send(null);
}

function handleHttpResponse(updateElementId) {
  if (http.readyState == 4) {
    // Split the comma delimited response into an array
    results = http.responseText.split(";");
  alert('test');
    elements = updateElementId.split(";");
    for(i=0;i<results.length;i++) {
      document.getElementById(elements[i]).value = results[i];
    }
  }
}

function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}

var http = getHTTPObject(); // We create the HTTP Object
</script>