使用javascript获取当前网页中的rss/atom链接地址
JavaScript:
-
function getFeedUrl()
-
{
-
links=document.getElementsByTagName(“link”)
-
for(i in links){
-
link=links[i];
-
if (link.type)
-
{
-
if((link.type.toLowerCase()==“application/rss+xml”)||
-
(link.type.toLowerCase()==“application/atom+xml”))
-
{
-
return link.href;
-
}
-
}
-
}
-
}










June 18th, 2008 at 10:51 am
June 19th, 2008 at 5:15 pm
June 29th, 2008 at 9:05 am
June 30th, 2008 at 3:32 am
July 9th, 2008 at 2:22 am
July 10th, 2008 at 1:34 pm