主要函数: 代码如下: <!-- function getObject(objectId) { if(document.getElementById && document.getElementById(objectId)) { // W3C DOM return document.getElementById(objectId); } else if (document.all && document.all(objectId)) { // MSIE 4 DOM return document.all(objectId); } else if (document.layers && document.layers[objectId]) { // NN 4 DOM.. note: this won't find nested layers return document.layers[objectId]; } else { return false; } }
var responsecont; var xmlHttp; var requestType; var newsstring;
function CreateXMLHttpRequest(){ // Initialize Mozilla XMLHttpRequest object if (window.XMLHttpRequest){ xmlHttp = new XMLHttpRequest(); } // Initialize for IE/Windows ActiveX version else if (window.ActiveXObject) { try{ xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e){ try{ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){newsstring = "<div class='loading'>Loading rquest content fail, Please try it again latter...</div>";} } } }
function getnews(tagid,x){ var url = tagid+'_'+x+'.htm'; var loadstatustext="<div class='loading'><img src='images/loading.gif' /> Loading request content, please wait...</div>"; requestType = tagid;