function Handlestatechange () {
if (xmlhttp.readystate = = 4) {
if (Xmlhttp.status = = 200) {
ResultSet ();
}
}
}
function ResultSet () {
var results = Xmlhttp.responsexml;
var title = null;
var item = NULL;
var link=null;
Get Channel
var ccc=results.getelementsbytagname ("channel");
var headtitle=ccc[0].getelementsbytagname ("title") [0].firstchild.nodevalue;
var headlink=ccc[0].getelementsbytagname ("link") [0].firstchild.nodevalue;
var cell = document.createelement ("div");
Cell.innerhtml= "document.getElementById ("Result"). AppendChild (cell);
Get items
var items = results.getelementsbytagname ("item");
for (var i = 0; i < items.length; i++) {
item = Items[i];
Link=item.getelementsbytagname ("link") [0].firstchild.nodevalue;
title = Item.getelementsbytagname ("title") [0].firstchild.nodevalue;
var cell = document.createelement ("div");
Cell.innerhtml= "<a href=" +link+ "target=_blank>" +title+ "</a><br>";
document.getElementById ("Result"). AppendChild (cell);
}
}
function Readrss1 ()
{
var Url=document.getelementbyid ("Txturl"). Value;
if (url== "")
{
Alert ("Please enter an RSS address");
}
Else
{
Readrss (URL);
}
}
</script>
<body ">
<form >
<a href= "Javascript:readrss (http://www.blogjava.net/rss.aspx)" >blogjava Original area </a>
<a href= "Javascript:readrss (http://beginner.blogjava.net/rss.aspx)" >blogjava Novice Area </a>
<a href= "Javascript:readrss (http://life.blogjava.net/rss.aspx)" >blogjava Non-technical zone </a>
<a href= "Javascript:readrss (http://general.blogjava.net/rss.aspx)" > Comprehensive area </a>
<br>
Enter an RSS address: <input type= "text" value= "http://www.blogjava.net/wujun/rss.aspx" size=50 id= "Txturl" >
<input type= "button" value= "View" onclick= "Readrss1 ()" >
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.