I'm using JQuery to make a JSON request back to the server and it seems that it's parameter serialization is hard-coded to what PHP expects instead of being generic in nature. Basically I have an object that looks like this:
{
foo: 1,
bar : [1, 3, 5]
}
And it serializes it to:
foo=1&bar[]=1&bar[]=3&bar[]=5
Is there anyway to make it just do?
foo=1&bar=1&bar=3&bar=5
It seems to me that jQuery shouldn't be so tied to what a handful of server side frameworks expect as a naming convention. If I wanted my param to be called bar[]
I could easily name it that myself if it's what my server-side code expects.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…