hi,
i have a controller which prints out json data

function grid_data()
        {
                  $projects =  $this->Project->getProjects();
                  $rows=2;
                  echo 
$_GET['callback'].'({"total":"'.$rows.'","results":'.$this-
>json->encode($projects).'})';

        }



the javascript for my datagrid calls
http://localhost/cake/projects/grid_data

the json string is printed out but also the html code from
default.thtml...is there a way to avoid printing the html code?

http://localhost/cake/projects/grid_data
({"total":"2","results":
[{"id":"1","ProjectTitle":"Bumble","StartDate":"2007-05-10","EndDate":"2007-05-30","Status":"0","Type":"0"}]})
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
....

thx

pete


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to