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