As the introduction said I’m going to show you how I added the Ajax functionality to the Jambor-ee homepage, or more specifically, how you can replace certain content (in our case the showcase site details) through a user click without the need for a page refresh.
A few notes to begin with
- We’re going to make sure the additional functionality doesn’t get in the way of those people or devices without javascript enabled.
- We’re also going to make sure our templates are kept clean of inline javascript.
- We’re going to be using the prototype library.
So, taking the Jambor-ee homepage as an example we’re going to display some teasers from a gallery (showcase). There’ll be one “featured” item with a large image, title, text extract, and a link for more info. There’ll also be some further thumbs which once clicked, will replace the featured item. Without javascript enabled, clicking on the thumbnails or the featured item will take the user directly to that item’s single entry page.