Oops, I hit send too quickly:

$.post("example.php",
        "{A:'A'}",
        success: function (data) {
              alert(data.err)
        },
        'json'
);

On Dec 18, 2007 5:47 PM, Mike Alsup <[EMAIL PROTECTED]> wrote:
> You need to include the dataType property if you're expecting json back:
>
> $.post("example.php",
>          "{A:'A'}",
>          dataType: 'json',
>          function (data) {
>                alert(data.err)
>          });
>
> Mike
>
>
> On Dec 18, 2007 2:32 PM, mmoreira <[EMAIL PROTECTED]> wrote:
> >
> > Hello!
> >
> > Why return one object from php script called from $.post ();
> >
> > Example:
> >
> > $.post("example.php",
> >           "{A:'A'}",
> >           function (data) {
> >                 alert(data.err)
> >           });
> >
> > example.php
> >
> > print "{ ";
> > print " err: 'teste' ";
> > print "} ";
> >
> > This script not runnable correctly.
> >
> > Sorry my VERY BAD ENGLISH!
> >
> > rs...
> >
> > cya :P
> >
> > mmoreira
> >
>

Reply via email to