使用javascript获取当前网页中的rss/atom链接地址 Access to the use of javascript in the current Web page rss / atom link address
2007年03月25日• 追风逐月 • 分类: 技术开发 March 25, 2007 Herd monthly • • Category: Technology Development
JavaScript: JavaScript:
function getFeedUrl ( ) Function getFeedUrl ()
{ (
links=document. getElementsByTagName ( “link” ) = Document links. GetElementsByTagName (the "link")
for ( i in links ) { For (i in links) (
link=links [ i ] ; Link = links [i];
if ( link. type ) If (link. type)
{ (
if ( ( link. type . toLowerCase ( ) == “application/rss xml” ) || If ((link. type. ToLowerCase () == "application / rss xml") | |
( link. type . toLowerCase ( ) == “application/atom xml” ) ) (Link. type. ToLowerCase () == "application / atom xml"))
{ (
return link. href ; Return link. Href;
} )
} )
} )
} )
本文链接: http://chyni.com/develop/javascript-rss.html This paper links: http://chyni.com/develop/javascript-rss.html




