87,902
社区成员
发帖
与我相关
我的任务
分享
function download()
{
xmlHttpRequestDown =CreateXMLHttp();
if (!xmlHttpRequest)
{
alert("XMLHttpRequest创建失败!");
return;
}
var url="download.aspx?ran="+Math.random() ;
xmlHttpRequestDown.open("GET",url,true );
xmlHttpRequestDown.onreadystatechange = CallBackD;
//xmlHttpRequest.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded");
xmlHttpRequestDown.send(null);
}
function Progress()
{
xmlHttpRequest =CreateXMLHttp();
if (!xmlHttpRequest)
{
alert("XMLHttpRequest创建失败!");
return;
}
var url="ajax.aspx?num="+Math.random();
xmlHttpRequest.open("POST",url,true);
xmlHttpRequest.onreadystatechange = CallBack;
//xmlHttpRequest.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded");
xmlHttpRequest.send(null);
}
function zhaopin(q,ps,pn)
{
document.getElementById("zhaopin").innerHTML="<div id='loading'> 数据加载中,请稍后。<br /><img src='image/loading.gif' /></div>";
var xmlHttp=initajax();
var url="zhaopinsql.php?q=" + q+"&pagesize="+ps+"&pageno="+pn;
url=url+"&sid="+Math.random();
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=function(){ajaxcallback(xmlHttp,"zhaopin","<div id='loading'> 数据加载中,请稍后。<br /><img src='image/loading.gif' /></div>")};
xmlHttp.send(null);
}
function loadarea()
{
var xmlHttp=initajax();
var url="areasql.php";
url=url+"?sid="+Math.random();
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=function(){ajaxcallback(xmlHttp,"fenlei","数据加载中,请稍后。<img src='image/loading.gif' />")};
xmlHttp.send(null);
}
function ajaxcallback(xmlHttp,showid,loadingshow)
{
if(xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
document.getElementById(showid).innerHTML=xmlHttp.responseText;
}
}
else
{
document.getElementById(showid).innerHTML=loadingshow;
}
}