⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rss.js

📁 ajax快速入门,主要讲解原理与部门实现
💻 JS
字号:
function addLoadRSSTask(position,url,action){
	putLog(position+";"+url+";"+action+"<br>");
	var httpReq=new httpRequest(
		"GET",url,null,null,
		function() {
			if (this.readyState==4) {
				if(this.status==200){
					var blogfeed=blogList[position];
					if(blogfeed==undefined){
						blogList[position]=new Array();
						blogfeed=blogList[position];
						blogfeed.lastDateTime="";
					}
					blogfeed.state="loading";
					blogfeed.newitem=0;
					var xmldom=this.responseXML;
					var channel=xmldom.documentElement.selectSingleNode("channel");
					var blogtitle=getNodeString(channel,"title");				
					var bloglink=getNodeString(channel,"link");
					var blogdescription=getNodeString(channel,"description");
					var managingEditor=getNodeString(channel,"managingEditor");
					var pubDate=getNodeString(channel,"pubDate");
					var itemlist=channel.selectNodes("item");
					var blogitemlist=itemlist
					var image=channel.selectSingleNode("image");
					var tempLastTime="";
					for(var i=0;i<itemlist.length;i++){
						var node=itemlist[i];
						if(node.tagName=="item"){
							var pubDateTime=getNodeString(node,"pubDate");
							var goodDateTime=formatDateTime(pubDateTime);
							if(goodDateTime>blogfeed.lastDateTime){
								if(goodDateTime>tempLastTime) tempLastTime=goodDateTime;
								blogfeed.newitem++;
							}
						}
					}
					if(tempLastTime=="") tempLastTime=blogfeed.lastDateTime;
					blogfeed.tempLastTime=tempLastTime;
					blogfeed.blogtitle=blogtitle;
					blogfeed.bloglink=bloglink;
					blogfeed.xmllink=url;
					blogfeed.blogdescription=blogdescription;
					blogfeed.managingEditor=managingEditor;
					blogfeed.pubDate=pubDate;
					blogfeed.blogitemlist=blogitemlist;
					blogfeed.image=image;
					if(action=="insert"){
						insertOPML(position,blogfeed);
					} else if(action=="update"){
						updateOPML(position,blogfeed);
					}
					blogfeed.state="complate";
				}
			}
		},
		false);
	xmlHttpRequestManager.addTask(httpReq);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -