jQuery Ajax maintain POST Html notation

197 Views Asked by At

Is it possible to maintain the Php post notation using a Ajax Post. For example, if I do a standard post using a HTML form and var_export the $_POST data I can see the structure of any array data. I'd like to maintain this when using a Ajax Post, I've tried using jQuery serialise and serialiseArray but these don't maintain the same format.

1

There are 1 best solutions below

1
On

This should work like a charm:

$.post("test.php", $("#form").serialize(),
   function(data){
     alert(data);
});