DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> XML學習教程 >> XML詳解 >> 用Asp+XmlHttp實現RssReader功能
用Asp+XmlHttp實現RssReader功能
編輯:XML詳解     

  <style>
  body {margin:10px;background-color:#ffffff;margin-top:6px;}
  form{margin:0px;}
  * {font:12px tahoma;line-height:140%;color:#000000}
  .title {font-weight:bold;color:red;}
  .time {font:10px;color:#999999;}
  a {text-decoration:none;color:blue;}
  </style>
  <script type="text/Javascript">
  var switcher=0;
  </script>
  <body ondblclick="if(switcher==0){document.styleSheets[0].addRule('div','display:none');switcher=1}else{document.styleSheets[0].addRule('div','display:block');switcher=0}">
  <form name="rssform" method=post action="">
  RSS資源:<INPUT TYPE="text" NAME="RssFeed" size=60 style="height:22px" value="<%=request("RssFeed")%>" onfocus=select()> <input type="submit" value="Read It"> &nbsp;&nbsp;雙擊鼠標可以關閉摘要,只顯示標題
  </form>
  <hr/>
  <%
  If(request("RssFeed")="") Then
  url="/rss2.ASP"
  else
  url=request("RssFeed")
  End If
  Set xml = Server.CreateObject("Microsoft.XMLHTTP")
  XML.Open "GET", url, False
  XML.Send
  Set xmlDom = server.createObject("microsoft.XMLdom")
  XMLDom.async=False
  XMLDom.ValidateOnParse=false
  xmlDom.load(xml.responseXML)
  if XMLDom.ReadyState>2 Then 
  set oItem=XMLDom.getElementsByTagName("item")
  for i=0 to oItem.length-1
  response.write "<span style='font:bold 9px verdana;color:#000000'>"&i+1&"</span>. <a class='title' href='"&oItem(i).childNodes(1).text&"' target='_blank'>"&oItem(i).childNodes(0).text&"</a> <span class='time'>["&oItem(i).childNodes(3).text&"]<br />"
  response.write "<div>摘要:"&oItem(i).childNodes(4).text&"</div><br>"
  next
  end if
  %>


XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved