When you click on a fruit it will call a function that grabs the element, extracts its contents and sends it to a php file with a POST argument that goes like "user_pref_fruit=appeles"
The server will give some answer that will be put into a DOM document. It's contents are.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<answer>Oh you like bananas!</answer>
You then can use the XML DOM Code API to take the answer apart .... We juste extract the answer an append it to this page.
The source code for the JS part is in this page (do "View Source") and the PHP part is ajax1.phps