当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - jQuery AJAX - push additional key/value pair into a serialized $_POST array

问题描述:

This question already has an answer here:

  • jQuery post() with serialize and extra data

    8 answers

网友答案:

the $(form).serialize() just return a string so you can simply concat with the value you want to add. Example :

var formData = $('#advertiser-edit-form').serialize();
// Be sure that formData is not empty, if it's you don't need the "&"
formData += '&foo=bar';

https://api.jquery.com/serialize/

分享给朋友:
您可能感兴趣的文章:
随机阅读: