日期:2014-05-16 浏览次数:20654 次
<script language="javascript" src="MyScripts/ajax.js"></script> <script type="text/javascript"> window.onload = function () { ajax({ url: "rss.xml", onSuccess: function( rss ){ var feed = document.getElementById( "feed" ); var titles=rss.getElementsByTagName( "title" ); for(var i=0; i < titles.length; i++ ){ var li=document.createElement( "li" ); li.innerHTML=titles[i].firstChild.nodeValue; feed.appendChild(li); } } }); }; </script> </head> <body> <h1> Dynamic RSS Feed widget</h1> <p>check out my RSS Feed:</p> <ol id="feed"> </ol> </body> </html>