ajax.js里面有内容显示效果,根据ID

风,从水中掠过,留下粼粼波纹;阳光,从云中穿过,留下丝丝温暖;岁月,从树林中走过,留下圈圈年轮。
ajax.js里面有内容显示效果,根据ID

varhttp_request=false;
varsuccess=false;
varShowAllListFlag=1;
varDisplayArticle=true;
functionmakeRequest(url,cateID){ http_request=false; if(window.XMLHttpRequest){//Mozilla,Safari,...
http_request=newXMLHttpRequest();
if(http_request.overrideMimeType){
http_request.overrideMimeType('text/xml');
}
}elseif(window.ActiveXObject){//IE
try{
http_request=newActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
http_request=newActiveXObject("Microsoft.XMLHTTP");
}catch(e){}
}
} if(!http_request){
alert('Givingup:(CannotcreateanXMLHTTPinstance');
returnfalse;
}
http_request.onreadystatechange=alertContents;
http_request.open('GET',url,false);
http_request.send(null);
if(success==true)
{
try{
cateID.innerHTML=http_request.responseText;
}catch(e){} success==false;
} } functionalertContents(){ if(http_request.readyState==4){
if(http_request.status==200){
success=true;
}else{
alert('Therewasaproblemwiththerequest.');
}
} } functionsetCatlog(ID,Order,LeftNumber){ varcateID=document.getElementById('Cate'+ID);
setdisplay(cateID);
if(cateID.style.display=="")
{
varurl2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&Order="+Order+"&LeftNumber="+LeftNumber+"&r="+Math.random();
makeRequest(url2,cateID);
}
else
{
varurl2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&RemoveID=1&r="+Math.random();
makeRequest(url2,cateID);
}
} functionsetArticleList(EncodeURL,ArticleID){ if(DisplayArticle==true)
{
try{varobjArticleIDtop=document.getElementById('top'+ArticleID);
varobjArticleIDbottom=document.getElementById('bottom'+ArticleID);
if(objArticleIDtop)
{
if(objArticleIDtop.style.display=="none")
{ objArticleIDtop.style.display="";
}
else
{ objArticleIDtop.style.display="none";
}
}
if(objArticleIDbottom)
{
if(objArticleIDbottom.style.display=="none")
{
varurl2="INCLUDE/GetArticleFunction.asp?LinkStr="+EncodeURL+"&r="+Math.random();
makeRequest(url2,objArticleIDbottom);
objArticleIDbottom.style.display="";
}
else
{ objArticleIDbottom.style.display="none";
}
} }catch(e){alert(e.description);}
}
else
{
} }
functionDisplayContent(ArticleID){ if(DisplayArticle==true)
{
try{varobjArticleIDtop=document.getElementById('top'+ArticleID);
varobjArticleIDbottom=document.getElementById('bottom'+ArticleID);
if(objArticleIDtop)
{
if(objArticleIDtop.style.display=="none")
{ objArticleIDtop.style.display="";
}
else
{ objArticleIDtop.style.display="none";
}
}
if(objArticleIDbottom)
{
if(objArticleIDbottom.style.display=="none")
{ objArticleIDbottom.style.display="";
}
else
{ objArticleIDbottom.style.display="none";
}
} }catch(e){alert(e.description);}
}
else
{
} } functionsetdisplay(cateID){
if(cateID.style.display=="none")
{
cateID.style.display="";
cateID.innerHTML="Loading..."
}
else
{
cateID.style.display="none";
}
} functionsetdisplay2(cateID){ if(ShowAllListFlag==1)
{
cateID.style.display="";
cateID.innerHTML="Loading..."
}
else
{
cateID.style.display="none";
}
} functionShowAllList(Order,LeftNumber,TagName){
varobj=document.getElementsByTagName(TagName) for(a=0;a<obj.length;a++)
{
if(obj[a].className=="SiteList")
{
obj2=obj[a].id;
varID=obj2.replace("Cate","");
varcateID=document.getElementById(obj2);
setdisplay2(cateID);
if(cateID.style.display=="")
{
varurl2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&Order="+Order+"&LeftNumber="+LeftNumber+"&r="+Math.random();
makeRequest(url2,cateID);
}
else
{
varurl2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&RemoveID=1&r="+Math.random();
makeRequest(url2,cateID);
} } } if(ShowAllListFlag==1)
{
ShowAllListFlag=2;
}
else
{
ShowAllListFlag=1;
} } functionExpandListBySession(Str,Order,LeftNumber){
try{
varExpandList=Str.split("|"); for(b=0;b<ExpandList.length-1;b++)
{
setCatlog(ExpandList[b],Order,LeftNumber)
}
}catch(e){} }

到此这篇关于ajax.js里面有内容显示效果,根据ID就介绍到这了。不论你在什么时候开始,重要的是开始之后就不要停止。更多相关ajax.js里面有内容显示效果,根据ID内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!

您可能有感兴趣的文章
jQuery实现基本隐藏与显示效果的方法详解

javascript+jQuery实现360开机时间显示效果

微信小程序画布圆形进度条显示效果

Bootstrap实现的标签页内容切换显示效果示例

js实现做通讯录的索引滑动显示效果和滑动显示锚点效果