Tuesday, March 3, 2009

Re: Debug Comment Data in JSON Results

Ahh, I see. Didn't think to write the debug configuration based on the
request.

Annoying though that it appends that right? What practical purpose
could it serve?

Thank you,
Alex

On Mar 3, 11:57 am, bcreeve <bcre...@gmail.com> wrote:
> What I do is parse .json extensions and return the JSON with
> Configure::write('debug', 0); like brian stated.
>
> If I want to see what errors I'm getting when things bomb, I can hit
> the same URL without the extension to return the data as HTML in the
> default layout while respecting the environment's debug mode.
>
> On Mar 3, 2:43 pm, brian <bally.z...@gmail.com> wrote:
>
> > On Tue, Mar 3, 2009 at 2:09 PM, Alex <alex.gibb...@gmail.com> wrote:
>
> > > I'm using the javascript->object() method to return JSON data for XHR
> > > requests. All works great when the cake debug level is set to 0, but
> > > when higher will append an html style comment to my JSON data like so:
> > > "<!-- 0.5613s -->", indicating the response time of the request. This
> > > prohibits the JSON data from being evaluated. Is there anyway to keep
> > > a non-zero debug level and keep cake from appending this value?
>
> > Do you mean, so that you can see debugging info aside from the XHR request?
>
> > Configure::write('debug', 0);
>
> > ... just before you send the JSON data. This way, you can see
> > debugging info elsewhere. There's no practical way to output debugging
> > info *with* your JSON data, as you've already seen.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: