1

Is there a way to get recent articles using JavaScript from Wordpress blog? I need to show some content from the blog easy way on a static page so I think JavaScript would be fine for this.

Sergei Basharov
  • 51,276
  • 73
  • 200
  • 335
  • This will only work if you're on the same domain. Otherwise no, it won't be fine. – Anders Jul 20 '10 at 07:52
  • Yes, it's just a static html site with a Wordpress blog in a separate folder domain.com/blog. What I need is to place recent entries on the main page of that static site from that blog. – Sergei Basharov Jul 20 '10 at 10:01

1 Answers1

1

If you are in different domain, you cannot do this with pure javascript. You will need to use serverside proxy (for example, PHP proxy - a file which will take URL, do request and return data). After you got data, just use jQuery ability to parse XML files and write your HTML.

Parse RSS with jQuery

Community
  • 1
  • 1
Māris Kiseļovs
  • 16,957
  • 5
  • 41
  • 48