zoukankan      html  css  js  c++  java
  • ASP读取RSS

    <% @language="VBScript"%>
    
    <%
    Function readrss(xmlseed)
    dim xmlDoc 
    dim http
    Set http=Server.CreateObject("Microsoft.XMLHTTP") 
    http.Open "GET",xmlseed,False 
    http.send 
    Set xmlDoc=Server.CreateObject("Microsoft.XMLDOM") 
    xmlDoc.Async=False 
    xmlDoc.ValidateOnParse=False 
    xmlDoc.Load(http.ResponseXML)
    Set item=xmlDoc.getElementsByTagName("item")
    if item.Length<=10 then
    %>
    <script language="JavaScript">
    alert("对不起,该新闻条数已经少于10条新闻条数!");
    </script>
    <%
    else
    For i=0 To (item.Length-1)
    Set title=item.Item(i).getElementsByTagName("title")
    Set link=item.Item(i).getElementsByTagName("link")
    Response.Write("<a href="""& link.Item(0).Text &""" target='_blank'>"& title.Item(0).Text &"</a><br>")
    Next
    end if
    End Function
    %>
    <html>
    <head>
    <title>远程读取XML文件</title>
    </head>
    <body>
    <%
    call readrss("http://www.yangzhi.com/rss.asp")
    %>
    <br><br>
    
    </body>
    </html>
    

      

  • 相关阅读:
    jsp 页面获取当前路径
    html5 页面音频
    微信关于网页授权access_token和普通access_token的区别
    Texlive source
    vscode 快捷键
    vscode setting
    vscode extension 插件管理
    what
    linux manual
    java tool type
  • 原文地址:https://www.cnblogs.com/uuxanet/p/3284730.html
Copyright © 2011-2022 走看看