以下是网学网为您推荐的Ajax-ajax.js里面有内容显示效果,根据ID,希望本篇文章对您学习有所帮助。
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 {
ca