Time for action – retrieving and processing the post list

Now we're ready to retrieve the list of latest posts and process them, making them ready to be displayed as items in the marquee. In order to access this data across the Internet from another domain, we need to use JSONP, which stands for JSON with Padding, and involves dynamically creating and injecting a <script> element to the page, although jQuery actually handles this aspect of it for us.

  1. jQuery provides native support for JSONP and allows us to bypass the same-origin security policy of the browser. In order to output JSON in the correct format, I'm using the JSON API plugin on a WordPress-powered blog, which outputs JSON in the following format:
    { "status": "ok", "count": 1, "count_total": ...

Get jQuery 1.4 Animation Techniques Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.