开发者

post json array via jquery.post?

开发者 https://www.devze.com 2023-04-02 02:41 出处:网络
After a series of attempts working on json, now I have another challenge - How can post this type of json array,

After a series of attempts working on json, now I have another challenge - How can post this type of json array,

[{"success":true,"filename":"agard.jpg"}]

jquery.post,

$.post("process.p开发者_开发百科hp", json ,function(xml){

});

So I can get this array in process.php using print_r($_POST):

Array
(

    [success] => true
    [filename] => agard.jpg
)


You need to pass an object not an array, you can put the array in your object though.

{"0":[{"success":true,"filename":"agard.jpg"}]}
0

精彩评论

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