ajax.js里面有内容显示效果,根据ID
复制代码 代码如下:
var http_request = false;
var success=false;
var ShowAllListFlag=1;
var DisplayArticle=true;
function makeRequest(url,cateID) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
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;
}
}
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
success=true;
} else {
alert('There was a problem with the request.');
}
}
}
function setCatlog(ID,Order,LeftNumber) {
var cateID=document.getElementById('Cate'+ID);
setdisplay(cateID);
if (cateID.style.display=="")
{
var url2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&Order="+Order+"&LeftNumber="+LeftNumber+"&r="+Math.random();
makeRequest(url2,cateID);
}
else
{
var url2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&RemoveID=1&r="+Math.random();
makeRequest(url2,cateID);
}
}
function setArticleList(EncodeURL,ArticleID) {
if (DisplayArticle==true)
{
try { var objArticleIDtop = document.getElementById('top'+ArticleID);
var objArticleIDbottom = 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")
{
var url2="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
{
}
}
function DisplayContent(ArticleID) {
if (DisplayArticle==true)
{
try { var objArticleIDtop = document.getElementById('top'+ArticleID);
var objArticleIDbottom = 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
{
}
}
function setdisplay(cateID) {
if (cateID.style.display=="none")
{
cateID.style.display="";
cateID.innerHTML="Loading..."
}
else
{
cateID.style.display="none";
}
}
function setdisplay2(cateID) {
if (ShowAllListFlag==1)
{
cateID.style.display="";
cateID.innerHTML="Loading..."
}
else
{
cateID.style.display="none";
}
}
function ShowAllList(Order,LeftNumber,TagName) {
var obj = document.getElementsByTagName(TagName)
for (a=0;a<obj.length;a++)
{
if (obj[a].className=="SiteList")
{
obj2=obj[a].id;
var ID=obj2.replace("Cate","");
var cateID=document.getElementById(obj2);
setdisplay2(cateID);
if (cateID.style.display=="")
{
var url2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&Order="+Order+"&LeftNumber="+LeftNumber+"&r="+Math.random();
makeRequest(url2,cateID);
}
else
{
var url2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&RemoveID=1&r="+Math.random();
makeRequest(url2,cateID);
}
}
}
if (ShowAllListFlag==1)
{
ShowAllListFlag=2;
}
else
{
ShowAllListFlag=1;
}
}
function ExpandListBySession(Str,Order,LeftNumber) {
try {
var ExpandList=Str.split("|");
for (b=0;b<ExpandList.length-1;b++)
{
setCatlog(ExpandList[b],Order,LeftNumber)
}
} catch (e) {}
}
复制代码 代码如下:
var http_request = false;
var success=false;
var ShowAllListFlag=1;
var DisplayArticle=true;
function makeRequest(url,cateID) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
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;
}
}
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
success=true;
} else {
alert('There was a problem with the request.');
}
}
}
function setCatlog(ID,Order,LeftNumber) {
var cateID=document.getElementById('Cate'+ID);
setdisplay(cateID);
if (cateID.style.display=="")
{
var url2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&Order="+Order+"&LeftNumber="+LeftNumber+"&r="+Math.random();
makeRequest(url2,cateID);
}
else
{
var url2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&RemoveID=1&r="+Math.random();
makeRequest(url2,cateID);
}
}
function setArticleList(EncodeURL,ArticleID) {
if (DisplayArticle==true)
{
try { var objArticleIDtop = document.getElementById('top'+ArticleID);
var objArticleIDbottom = 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")
{
var url2="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
{
}
}
function DisplayContent(ArticleID) {
if (DisplayArticle==true)
{
try { var objArticleIDtop = document.getElementById('top'+ArticleID);
var objArticleIDbottom = 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
{
}
}
function setdisplay(cateID) {
if (cateID.style.display=="none")
{
cateID.style.display="";
cateID.innerHTML="Loading..."
}
else
{
cateID.style.display="none";
}
}
function setdisplay2(cateID) {
if (ShowAllListFlag==1)
{
cateID.style.display="";
cateID.innerHTML="Loading..."
}
else
{
cateID.style.display="none";
}
}
function ShowAllList(Order,LeftNumber,TagName) {
var obj = document.getElementsByTagName(TagName)
for (a=0;a<obj.length;a++)
{
if (obj[a].className=="SiteList")
{
obj2=obj[a].id;
var ID=obj2.replace("Cate","");
var cateID=document.getElementById(obj2);
setdisplay2(cateID);
if (cateID.style.display=="")
{
var url2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&Order="+Order+"&LeftNumber="+LeftNumber+"&r="+Math.random();
makeRequest(url2,cateID);
}
else
{
var url2="INCLUDE/GetSiteListFunction.asp?ID="+ID+"&RemoveID=1&r="+Math.random();
makeRequest(url2,cateID);
}
}
}
if (ShowAllListFlag==1)
{
ShowAllListFlag=2;
}
else
{
ShowAllListFlag=1;
}
}
function ExpandListBySession(Str,Order,LeftNumber) {
try {
var ExpandList=Str.split("|");
for (b=0;b<ExpandList.length-1;b++)
{
setCatlog(ExpandList[b],Order,LeftNumber)
}
} catch (e) {}
}
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
更新日志
2024年11月06日
2024年11月06日
- 雨林唱片《赏》新曲+精选集SACD版[ISO][2.3G]
- 罗大佑与OK男女合唱团.1995-再会吧!素兰【音乐工厂】【WAV+CUE】
- 草蜢.1993-宝贝对不起(国)【宝丽金】【WAV+CUE】
- 杨培安.2009-抒·情(EP)【擎天娱乐】【WAV+CUE】
- 周慧敏《EndlessDream》[WAV+CUE]
- 彭芳《纯色角3》2007[WAV+CUE]
- 江志丰2008-今生为你[豪记][WAV+CUE]
- 罗大佑1994《恋曲2000》音乐工厂[WAV+CUE][1G]
- 群星《一首歌一个故事》赵英俊某些作品重唱企划[FLAC分轨][1G]
- 群星《网易云英文歌曲播放量TOP100》[MP3][1G]
- 方大同.2024-梦想家TheDreamer【赋音乐】【FLAC分轨】
- 李慧珍.2007-爱死了【华谊兄弟】【WAV+CUE】
- 王大文.2019-国际太空站【环球】【FLAC分轨】
- 群星《2022超好听的十倍音质网络歌曲(163)》U盘音乐[WAV分轨][1.1G]
- 童丽《啼笑姻缘》头版限量编号24K金碟[低速原抓WAV+CUE][1.1G]