Hey guys. Thanks for all the responses. I set my debug to 2 and I
started getting something in my response, but it's not what I wanted.
It looks like my database query might be failing for some reason.
Also, according to firebug, my request still isn't being seen as JSON.
I've tried "text/javascript", "text/json", "application/json", and
"text/x-json" for my content types and haven't had luck with any of
them.
Thanks again for all of the help guys. More code is below.
Here's the top of my posts_controller.php
<?php class PostsController extends AppController {
var $name = 'Posts';
var $helpers = array('Html', 'Javascript');
var $components = array('RequestHandler');
function beforeFilter() {
$this->RequestHandler->setContent('json', 'application/json');
}
function index() {
$this->set('posts', $this->Post->find('all'));
}
Response Headers
Date: Fri, 05 Sep 2008 05:02:17 GMT
Server: Apache/2.2.8 (Win32) PHP/5.2.6
X-Powered-By: PHP/5.2.6
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Set-Cookie: CAKEPHP=deleted; expires=Thu, 06-Sep-2007 05:02:17 GMT;
path=/mkb CAKEPHP=bmeb29bq2qespggk12n08u9270; path=/mkb
CAKEPHP=jh3ff9d549ahss4h5hi5mgemq6; path=/mkb
CAKEPHP=bmeb29bq2qespggk12n08u9270; path=/mkb
Pragma: no-cache
Cache-Control: no-store, no-cache, max-age=0, must-revalidate
JSON: false
Content-Length: 646
Keep-Alive timeout=5, max=99
Connection: Keep-Alive
Content-Type: application/json
Request Headers
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Accept: application/json, text/javascript, */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://localhost/mkb/
Cookie: CAKEPHP=jh3ff9d549ahss4h5hi5mgemq6;
CAKEPHP=02sc14jclvued57ghlaprj0j11
false<!-- 0.4105s --><table class="cake-sql-log"
id="cakeSqlLog_122059093848c0bd5a3a9469_28718392" summary="Cake SQL
Log" cellspacing="0" border = "0">
<caption>1 query took 0 ms</caption>
<thead>
<tr><th>Nr</th><th>Query</th><th>Error</th><th>Affected</th><th>Num.
rows</th><th>Took (ms)</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`,
`Post`.`created`, `Post`.`modified` FROM `posts` AS `Post` WHERE
`Post`.`id` = 'post' LIMIT 1</td><td></td><td style =
"text-align: right">0</td><td style = "text-align: right">0</td><td
style = "text-align: right">0</td></tr>
</tbody></table>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---