sp;(!http_request)
{
alert(''不能创建 XMLHttpRequest 对象!'');
return
false;
}
http_request.onreadystatechange = function
(){likeakak(htmlid);}//processRequest(htmlid)
http_request.open(''GET'',
url, true);
http_request.send(null);
}
//处理返回信息
function processRequest(htmlid) {
if
(http_request.readyState == 1)
{
document.getElementById(htmlid).innerHTML="
下载中...";
}
if
(http_request.readyState == 4) {
if (http_request.status == 200)
{
document.getElementById(htmlid).innerHTML=http_request.responseText;
}
else
{
alert(''请求异常'');
}
}
}
//处理返回信息
function
likeakak(htmlid)
{
if (http_request.readyState == 1)
{
document.getElementById(htmlid).innerHTML="
下载中...";
}
if
(http_request.readyState == 4) {
if (http_request.status == 200)
{
document.getElementById(htmlid).innerHTML=http_request.responseText;
}
else
{
alert(''请求异常'');
}
}
}
function
ajaxaction(url,viewid)
{
send_request(url,viewid);
}
//自定义调用函数
function elist(id)
{
var inputarray = new
Array();
inputarray = ''aaa'';
inputarray =
''bbb'';
inputarray = ''ccc'';
inputarray =
''ddd'';
inputarray = ''eee'';
send_request(''ajax.php?do=ajax&sort=''+id,inputarray[id]);
}
</script>