Note: FIREFOX3 and IE7 seems to have the same behavior, but "json" datatype
seem give more problems than "text"

2009/2/25 Dakkar <[email protected]>

> Hi all,
>    I'm trying to use jQuery to send forms to a PHP script, but I've
> encountered some problems:
> - with $.post it works only with an alert just after the $.post
> instruction
> - with $.ajax it works without that alert only with async:false option
> - with both methods it works only with text datatype, but not json
> datatype
>
> the problem is about success (and error) callbacks that are not called
> properly, but the PHP script it's correctly called.
>
> CODE___
>                /*$.post('include/saveconf.php', serialized, function(data,
> status){
>
>                                                    alert(data);
>
>                                            }, "json");*/
>                $.ajax({
>                        url: 'include/saveconf.php',
>                        async: false,
>                        type: 'POST',
>                        data: serialized,
>                        dataType: 'text',
>                        timeout: 1000,
>                        error: function(e){
>                                alert("AJAX error!\n"+e.statusText);
>                        },
>                        success: function(data, status){
>                                alert(data+"\n"+status);
>                        }
>                });
>                //alert('after-post');
> ___CODE
>
>
> Thank you in advance!
> Dakkar

Reply via email to