You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
|
13 years ago
|
// Get the HTTP Object
|
||
|
|
function getHTTPObject(){
|
||
|
|
if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
|
||
|
|
else if (window.XMLHttpRequest) return new XMLHttpRequest();
|
||
|
|
else {
|
||
|
|
alert("Your browser does not support AJAX.");
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Change the value of the outputText field
|
||
|
|
function setOutput(){
|
||
|
|
if(httpObject.readyState == 4){
|
||
|
|
document.getElementById('element_list').innerHTML = httpObject.responseText;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// search function
|
||
|
|
function search_user(){
|
||
|
|
httpObject = getHTTPObject();
|
||
|
|
if (httpObject != null) {
|
||
|
|
var value = "inputText="+document.getElementById('inputText').value;
|
||
|
|
httpObject.open("POST", "keypress/");
|
||
|
|
httpObject.send(value)
|
||
|
|
httpObject.onreadystatechange = setOutput;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function search_user_hist(){
|
||
|
|
httpObject = getHTTPObject();
|
||
|
|
if (httpObject != null) {
|
||
|
|
var value = "inputText="+document.getElementById('inputText').value;
|
||
|
|
httpObject.open("POST", "keypress/");
|
||
|
|
httpObject.send(value)
|
||
|
|
httpObject.onreadystatechange = setOutput;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
var httpObject = null;
|