开发者

jQuery Ajax maintain POST Html notation

开发者 https://www.devze.com 2023-02-08 20:29 出处:网络
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\'

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 th开发者_运维知识库e same format.


This should work like a charm:

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

精彩评论

暂无评论...
验证码 换一张
取 消