jQuery: Posting an array quirk with square brackets

前端 未结 1 1954
后悔当初
后悔当初 2021-01-22 17:06

I\'m using the following code to make a post.

var checked = [\"2231\",\"2432\"];

jQuery.ajax({
            type: \'post\',
            url: statusUrl,
                  


        
相关标签:
1条回答
  • 2021-01-22 17:35

    The brackets are an indicator to the server for it to expect multiple similarly named parameters that should form an array or list. this is pretty standard, however, you can change the way it's done by setting the traditional setting to true. http://api.jquery.com/jquery.ajax

    0 讨论(0)
提交回复
热议问题