atom_js.asp

复制代码 代码如下:

<%                     
' I converted some of your example found on http://www.iteam5.net/francesco/atom/ over to jscript. 
' Feel free to use it and keep up the good work.
' Tyson Kopczynski
' tyson@cco.com


           function atom(strURL)
          {
           var objXML = new ActiveXObject("msxml2.DOMDocument.3.0");
           objXML.async = false;
           objXML.setProperty("ServerHTTPRequest", true);
           objXML.validateOnParse = true;
           objXML.preserveWhiteSpace = false;

           if (!objXML.load(strURL))
            {
             var array = new Array();

             Response.Write("<P>ERROR<br>code: " + objXML.parseError.errorCode)
             Response.Write("<br>Linea/Col: " + objXML.parseError.line & "/" + objXML.parseError.linepos)
             Response.Write("</P>")

             return(array)
            }
           else
            {
             var objNodeList = objXML.getElementsByTagName("entry");
             var arrDicts = new Array(objNodeList.length);

             for (var i=0; i<objNodeList.length; i++) 
              {
               arrDicts[i] = new ActiveXObject("Scripting.Dictionary");

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3142.html