What are you using to encode your json server side? If you have PHP
5.2 and above, I'd suggest json_encode, which takes a PHP array and
converts it into json. To output a 1, you should be able to do the
following:

echo json_encode(array("error"=>"1"));

- jake

On Fri, Feb 15, 2008 at 3:48 PM, FrEaKmAn <[EMAIL PROTECTED]> wrote:
>
>  Hello,
>
>  so today I started with jquery and wow :D I have one question
>  regarding json. I found this topic (I'm sorry if linking isn't
>  allowed)
>
>  
> http://www.designerstalk.com/forums/programming/29651-jquery-ajax-question.html
>
>  I want something similar:
>  ...
>  success: function(json){
>         if( json.success == "true" ) {
>
>         } else {
>                 if(json.error == "1") {
>
>                 } ....
>  but it's doesn't want to work with my script. Now is jquery.js
>  (latest) enough or must I include special addons? Or this works and my
>  php file isn't right; any info how to set error to be equal to 1?
>
>  Thanks for help!
>
>

Reply via email to