安庆信息港
育儿
当前位置:首页 > 育儿

使用prototypejs写的读取RSS

发布时间:2019-06-19 23:40:43 编辑:笔名

  使用写的读取RSS的例子,代码如下:

  html

  head

  titleReadRSS /title

  script src="common/" /script

  script

  function send_Request(url)

  {

  var request_url =url;//跨域的话,需要写一个代理.

  var request_pars = null;

  var myAjax = new quest(

  request_url,

  {

  method:'get',

  parameters:request_pars,

  asynchronous:true, //true---异步;false---同步.默认为true

  onComplete:processRequest

  }

  );

  }

  function processRequest(XML_Http_Request){

  var results = XML_Http_sponseXML;

  var title = null;

  var item = null;

  var link = null;

  var ccc = tElementsByTagName("channel");

  var headtitle = ccc[0].getElementsByTagName("title")[0].deValue;

  var headlink = ccc[0].getElementsByTagName("link")[0].deValue;

  var cell = eateElement("div");

  nerHTML = " h1 a href="+headlink+" target=_blank"+headtitle+" /a /h1 br";

  $("result").appendChild(cell);

  var items = tElementsByTagName("item");

  for(var i = 0; i ngth; i++) {

  item = items[i];

  link=tElementsByTagName("link")[0].deValue;

  title = tElementsByTagName("title")[0].deValue;

  var cell = eateElement("div");

  nerHTML = " li a href="+link+" target=_blank"+title+" /a /li br";

  $("result").appendChild(cell);

  }

  }

  var myGlobalHandlers = {

  onCreate:function (){

  ow('systemWorking');

  },

  onComplete:function (){

  if(tiveRequestCount == 0){

  de('systemWorking');

  }

  }

  };

  gister(myGlobalHandlers);

  /script

  /head

  body onLoad="javascript:send_Request('');"

  div id='systemWorking'Loading... /div

  div id="result" /div

  /body

  /html

  查看本文来源

四磨汤增加大肠蠕动
消化不良右上腹疼痛
四磨汤治疗老年便秘
友情链接