Perl JavaScript PHP
Pull request Compare This branch is 20 commits ahead, 10 commits behind jfhovinne:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
build
jquery
src
xml
.gitignore
GPL-license.txt
MIT-license.txt
Makefile
README.markdown
example-proxy.html
example.html
proxy.php
test-dist-packed.html
test-dist.html
test-src.html

README.markdown

jFeed : jQuery feed parser plugin

Copyright (C) 2007 Jean-François Hovinne

Dual-licensed under the MIT (MIT-license.txt) and GPL (GPL-license.txt) licenses.

Usage

jQuery.getFeed( settings );

settings

A set of key/value pairs that configure the Ajax request.

  • url: The feed URL (required).
  • data: The data to be sent to the server. See jQuery.ajax()'s data property.
  • cache: If set to false, it will force requested pages not to be cached by the browser. See jQuery.ajax()'s cache property.
  • dataType: The type of data (xml, html, script, xjson, jsonp or text) that you're expecting back from the server. By default, it will be "text" on Internet Explorer and "xml" on every other browser. See jQuery.ajax()'s dataType property.
  • success: A function to be called if the request succeeds. The function gets passed one argument: the JFeed object.
  • error: A function to be called if the request fails. The function is passed three arguments: The XMLHttpRequest object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "notmodified" and "parsererror".

Example:

jQuery.getFeed({
    url: 'rss.xml',
    success: function (feed) {
        alert( feed.title );
    },
    error: function (request, status, error) {
        alert( error );
    }
});

Please see the provided examples for more information.

A basic PHP proxy is also available (proxy.php), if you need to load external feeds (for testing purposes only, do not use it on public websites).

Feed properties

  • type
  • version
  • title
  • link
  • description
  • language
  • updated
  • items: an array of feed items

Feed item properties

  • title
  • link
  • description
  • updated
  • id
  • author