FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » json testing suggestions
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: json testing suggestions [message #184543 is a reply to message #184541] Wed, 08 January 2014 04:23 Go to previous messageGo to previous message
John Smith is currently offline  John Smith
Messages: 7
Registered: January 2014
Karma:
Junior Member
On Tue, 07 Jan 2014 20:33:21 -0500, BobMCT <r(dot)mariotti(at)fdcx(dot)net>
wrote:

> So my question is: can someone recommend some ways to properly debug
> the ajax/json process? I seem to remember firebug once having some
> Thanks for any advice/suggestions.
>
> ---
> This email is free from viruses and malware because avast! Antivirus protection is active.
> http://www.avast.com

Hi,

I still use json_encode like crazy, it works fantastic, no issues so
far;

You need to test two places
- On the php, ensure that you actually get something rendered. Are you
sure the php array or object is valid ? That is simple to test, put a
breakpoint there and run in debug, you figure out fast

- On the browser side, I assume you use some javascript framework,
jQuery or something. If you don't, please do it, it saves headache and
time. It is possible that the json crashes when it gets evaluated,
although if it is generated with json_encode this is less likely to
happen: locate you callback function and place a breakpoint in the
javascript code and see what comes.

Personally rather than leaving jQuery to eval my json, I prefer to
take the response as text and eval it myself - in between these two
likes of code, you can always alert(responsetext) and see what comes
back.

That always worked for me...
--
John
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Math Formula Question - Need Ideas
Next Topic: how did I wind up with double headers?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 20:56:44 GMT 2024

Total time taken to generate the page: 0.04149 seconds