Why does the jQuery function param postfix the elements of an array with []

When using $.param to convert an array to a query string the generated elements are postfixed with []. Why is this the case and can I prevent this?

$.param({p: [1, 2]}); -> "p%5B%5D=1&p%5B%5D=2"

84 thoughts on “Why does the jQuery function param postfix the elements of an array with []”

  1. It’s a shame you don’t have a donate button! I’d without a doubt
    donate to this excellent blog! I suppose for now i’ll settle for book-marking and adding your RSS feed to my Google account.
    I look forward to brand new updates and will talk about this blog with my Facebook
    group. Talk soon! http://droga5.net/

    Reply

Leave a Comment