Search code examples
jqueryhtml-content-extraction

jQuery: getting/parsing content from different sites


I'd like to do the following: grab news from several sites, parse their content using jQuery selectors and show them on one page.

How could this be done with jQuery?

Thanks.


Solution

  • For security reason's JavaScript (and thus jQuery) AJAX methods can only retrieve data from URL's on the same domain as your site.

    There are some work-around's however. You could use a server-side script to download remote content for you - think of it like a proxy. Alternatively you could look into JSONP, but the remote site needs to provide it.