I'm a little unfamiliar in how CakePHP interacts with AJAX, so please forgive me if I've missed some critical points.
I've tried setting some beforeFilter settings in my AppController using RequestHandler, as follows: if($this->RequestHandler->isAjax()){ //set debug to 0 for this to always work Configure::write('debug', '0'); //$this->layout = 'json'; //$this->autoRender = false; $this->disableCache(); //might help if issues arise $this->RequestHandler->setContent('json', 'json'); } The two commented lines seem to break my jQuery $.ajax() call when not commented out, if I comment them out (as shown here), and instead place them in the specific controller's action rather than a beforeFilter, my jQuery call runs just fine. My "json" layout view is the following: <?php header("Pragma: no-cache"); header("Cache-Control: no-store, no-cache, max-age=0, must- revalidate"); header('Content-Type: application/json'); echo $content_for_layout; ?> My jQuery $.ajax() call's setup is below: var textValue = $('#notes').val(); var postData = 'data[DeskNote][desk_id]=' + StatTracker.deskId + '&data [DeskNote][note]=' + textValue; $.ajax({ type: 'GET', url: 'http://example.com/desks/view/1.json', dataType: 'json', timeout: (5 * 1000), //wait 5 seconds before going to FAIL state success: function(msg){ alert('success'); }, error: function(e){ alert('error'); } }); I guess I'm confused as to why the issue would cause error when set in a beforeFilter, and as I'm not entirely sure how to debug this (the AJAX is actually being called from a desktop application), it's causing me some confusion. Does anyone have any suggestion or enlightenment as to what I am possibly misunderstanding in how RequestHandler and json layouts work in tandem? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---