O'Reilly logo

jQuery 1.3 with PHP by Kae Verens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading accordion panels through Ajax

One of the advantages of accordions is that they allow you to read large tracts of text a little at a time.

As a consequence, we don't need to load all of the content as soon as the page is displayed, if it's not immediately required.

We should be able to simply show the available accordion panels, and when an accordion is selected, load its content from the server as the browser expands the panel.

To demonstrate this, I've written an example using a book, Great Expectations, by Charles Dickens.

Loading accordion panels through Ajax

You would most likely not sit down in front of your screen and read the whole book in one sitting. It makes sense that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required