views:

753

answers:

4

I've been looking around for a decent jQuery feed/XML parser and found good plugins like jFeed and jParse (among a few others). None of these support retrieving an external feed though, which is something I'm after.

Pretty sure this is down to jQuery's $.ajax() method rather than the plugins themselves (as they'll be built from this).

Is there some sort of hack I could use to override jQuery, or a raw JavaScript alternative? Better still would be a better plugin, but even the more popular ones I found didn't support it.

Thanks

A: 

If by retrieving an external feed you mean getting a feed from a different domain that the one your web application is, you can't (Same origin policy).

You will need some kind of proxy on the server side, like a PHP or python script (or whatever your favorite language is) that queries the external feeds and returns their contents to your application.

The jFeed plugin you checked has an example of a PHP proxy.

amercader
A: 

The answer looks to be on this page, using YQL instead of my own PHP proxy to handle the requests.

http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/

After finding out that it's not possible to do a simple JavaScript call to handle these requests, this jQuery plugin looks ideal, going to try it out later.

In fact, for parsing of RSS feeds without jQuery you can use the Google AJAX Feed API. Works a treat.

http://code.google.com/apis/ajaxfeeds/examples.html

Thanks for the replies

A: 

jFeed has a php proxy. I just had this need and jFeed was able to retrieve an external. PLease edit your comment if NOT using php is a requirement.

ANSWER (From what we know): Use jFeed!

:: However I just found out if your feed is 'not well-formed' it will break jFeed. :: Be warned

Juuccy