ajax自动完成
<table style= "BORDER-COLLAPSE: collapse " borderColor=#111111
cellSpacing=0 cellPadding=2 width=400 bgColor=#f5efe7 border=0>
<tr>
<td height= "20 ">
URL:
</td>
<td height= "20 ">
<input type= "text " size= "40 " id= "names " onkeyup= "findNames(); " style= "height:20; " >
<div style= "position:absolute; " id= "popup ">
<table id= "complete_table " bgcolor= "#FFFAFA " border= "0 " cellspacing= "0 " cellpadding= "0 "/>
<tbody id= "complete_body "> </tbody>
</table>
</div>
</td>
</table>
<script language= "javascript ">
var XMLHttpReq;
var completeDiv;
var inputField;
var completeTable;
var completeBody;
function createXMLHttpRequest() {
if(window.XMLHttpRequest) { //Mozilla 浏览器
XMLHttpReq = new XMLHttpRequest();
}
else if (window.ActiveXObject) { // IE浏览器
try {
XMLHttpReq = new ActiveXObject( "Msxml2.XMLHTTP ");
} catch (e) {
try {
XMLHttpReq = new ActiveXObject( "Microsoft.XMLHTTP ");
} catch (e) {}
}
}
}
function findNames() {
inputField = document.getElementById( "names ");
completeTable = document.getElementById( "complete_table ");
completeDiv = document.getElementById( "popup ");
completeBody = document.getElementById( "complete_body ");
if (inputField.value.length > 0) {
createXMLHttpRequest();
var url = "autoCompleteAja