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;