本文由桂林唯创网络原创,是经过我反复研究它的运行原理才总结出来的,如转载,请注明出处并保留作者相关信息(来源:桂林唯创网络www.93cn.net).
以下是正文:
function 函数名称(){
delete xmlhttp ;
var xmlhttp;
if (xmlhttp==null || typeof(xmlhttp)!="object"){
try{
xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');
}catch(e){
try{
xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');
}catch(e){
try{
xmlhttp= new XMLHttpRequest();
}catch(e){}
}
}
}
xmlhttp.onreadystatechange=function(){
if (4==xmlhttp.readyState){
if (200==xmlhttp.status){
var manage_online_str=xmlhttp.responseText;
//这里是你要进行处理的代码
}
//以下这3行代码重要,而且位置一定要在这里,释放内存主要就靠它了,注:这3行代码的位置一定要在if (4==xmlhttp.readyState){}里,否则无效或效果不好.
delete xmlhttp ;
xmlhttp=null;
CollectGarbage;
///////////////////////////////////
}
}
xmlhttp.open("post", "*.asp", true);
xmlhttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded;text/xml;charset=GB2312");
xmlhttp.send();
CollectGarbage();
clearTimeout(this);
}
window.setInterval("client_manage_online()",1000);
以下是正文:
function 函数名称(){
delete xmlhttp ;
var xmlhttp;
if (xmlhttp==null || typeof(xmlhttp)!="object"){
try{
xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');
}catch(e){
try{
xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');
}catch(e){
try{
xmlhttp= new XMLHttpRequest();
}catch(e){}
}
}
}
xmlhttp.onreadystatechange=function(){
if (4==xmlhttp.readyState){
if (200==xmlhttp.status){
var manage_online_str=xmlhttp.responseText;
//这里是你要进行处理的代码
}
//以下这3行代码重要,而且位置一定要在这里,释放内存主要就靠它了,注:这3行代码的位置一定要在if (4==xmlhttp.readyState){}里,否则无效或效果不好.
delete xmlhttp ;
xmlhttp=null;
CollectGarbage;
///////////////////////////////////
}
}
xmlhttp.open("post", "*.asp", true);
xmlhttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded;text/xml;charset=GB2312");
xmlhttp.send();
CollectGarbage();
clearTimeout(this);
}
window.setInterval("client_manage_online()",1000);
文章来源:桂林唯创网络