首页 > 编程 > ASP > 正文

atom_js.asp

2024-05-04 11:02:26
字体:
来源:转载
供稿:网友
复制代码 代码如下:
<%                     
' 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");
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表