jQuery RSS/ATOM feed parser plugin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test-src.html 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>jFeed - jQuery feed parser plugin - test</title>
  7. <script type="text/javascript" src="jquery/jquery.js"></script>
  8. <script type="text/javascript" src="src/jfeed.js"></script>
  9. <script type="text/javascript" src="src/jfeeditem.js"></script>
  10. <script type="text/javascript" src="src/jatom.js"></script>
  11. <script type="text/javascript" src="src/jrss.js"></script>
  12. <script type="text/javascript">
  13. jQuery(function() {
  14. var feedsUrls = ['xml/rss-091.xml',
  15. 'xml/rss-092.xml',
  16. 'xml/rss-10.xml',
  17. 'xml/rss-20.xml',
  18. 'xml/atom.xml'];
  19. jQuery().ajaxError(function(request, settings, ex) {
  20. console.log('Request error');
  21. for(var i in ex) {
  22. console.log(i + ': ' + ex[i]);
  23. }
  24. });
  25. for(var i = 0; i < feedsUrls.length; i++) {
  26. jQuery.getFeed({url: feedsUrls[i], success: function(feed) {
  27. console.log('feed type: ' + feed.type);
  28. console.log('feed version: ' + feed.version);
  29. console.log('feed title: ' + feed.title);
  30. console.log('feed link: ' + feed.link);
  31. console.log('feed description: ' + feed.description);
  32. console.log('feed language: ' + feed.language);
  33. console.log('feed updated: ' + feed.updated);
  34. console.log('feed items: ' + feed.items.length);
  35. for(var j = 0; j < feed.items.length; j++) {
  36. console.log('item ' + j + ' title: ' + feed.items[j].title);
  37. console.log('item ' + j + ' link: ' + feed.items[j].link);
  38. console.log('item ' + j + ' description: '
  39. + feed.items[j].description);
  40. console.log('item ' + j + ' updated: ' + feed.items[j].updated);
  41. console.log('item ' + j + ' id: ' + feed.items[j].id);
  42. }
  43. }
  44. });
  45. }
  46. });
  47. </script>
  48. </head>
  49. <body>
  50. <h1>jFeed - jQuery feed parser plugin - test</h1>
  51. <p>Please open Firefox + Firebug console</p>
  52. </body>
  53. </html>