gap_tooth_clan (3) [Avatar] Offline
I was having difficulty using the Yahoo YUI I kept getting javascript errors so I replaced it with some JQuery. All you need is the jQuery library from and put this code in

// perform the request.

$.getJSON(sUrl, function(data) {
$('#counts-'' of '+data.helpful_total);


instead of the YUI stuff. This processes on success but has not got a failure script.

My only problem is that the page www/zendbook/kids-days-out/public/review/feedback/format/json/id/1/helpful/0 includes the header, menu and footer. I am assuming this is what is causing me grief is there any way to stop them from being processed?

In Firebug on the net tab you can view the response it is as follows:

{"originalModule":"default","originalController":"review","originalAction":"feedback","result":true,"id" :1,"helpful_yes":"4","helpful_total":"5","menu":[{"title":"Home","url":"/www/zendbook/kids-days-out /public/"},{"title":"Browse Places","url":"/www/zendbook/kids-days-out/public/place/browse"} ,{"title":"Articles","url":"/www/zendbook/kids-days-out/public/articles"},{"title":"About","url" :"/www/zendbook/kids-days-out/public/about"}]}<div id="menu"> <ul id="main_menu"> <li> <a href="/www/zendbook/kids-days-out/public/">Home</a> </li><li> <a href="/www/zendbook/kids-days-out/public/place/browse">Browse Places</a> </li><li> <a href="/www/zendbook/kids-days-out/public/articles">Articles</a> </li><li> <a href="/www/zendbook/kids-days-out/public/about">About</a> </li></ul> </div>
jhartlep (3) [Avatar] Offline
Re: Chapter 5 AJAX, jSon returns menu, header and footer
Try using

if(!$request->isXmlHttpRequest()) { ... }

for your ActionSetup - Class on public function dispatchLoopStartup. Just put your code inside this if-statement...