Side navigation
#4177 closed bug (worksforme)
Opened February 18, 2009 12:28AM UTC
Closed February 18, 2009 12:50AM UTC
Last modified March 14, 2012 02:46PM UTC
jQuery.param() handles arrays very strangely
Reported by: | wmleler | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.3.2 |
Component: | core | Version: | 1.3.1 |
Keywords: | param array | Cc: | |
Blocked by: | Blocking: |
Description
If you create an object containing an array, and pass it to jQuery.param(), it creates two name/value pairs with the same name, which is not valid HTTP.
For example, $.param({ a: [5, 12], b: 'hello' }) creates a=5&a=12&b=hello
If I use this as a query string into PHP, it only sees a=12 (the 5 is lost).
Attachments (1)
Change History (1)
Changed February 18, 2009 12:50AM UTC by comment:1
resolution: | → worksforme |
---|---|
status: | new → closed |
I'm not sure what you mean by "not valid HTTP" since isn't related to the HTTP protocol. Try this sample code:
It will submit a GET request like this:
That would be equivalent to passing
to .PHP handles multivalued forms in a nonstandard way, so that may be what is causing confusion:
http://www.spsu.edu/cs/faculty/bbrown/papers/php2.html