mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Serialize: Fix object detection
jQuery.type doesn't just return "null" for null but also e.g. "array"
for arrays instead of object so it's not really a typeof analogue.
My suggestion was stupid. Sorry.
Refs 3d7ce0a65f
This commit is contained in:
parent
3d7ce0a65f
commit
14c0fe4432
@ -28,7 +28,7 @@ function buildParams( prefix, obj, traditional, add ) {
|
||||
|
||||
// Item is non-scalar (array or object), encode its numeric index.
|
||||
buildParams(
|
||||
prefix + "[" + ( jQuery.type( v ) === "object" ? i : "" ) + "]",
|
||||
prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
|
||||
v,
|
||||
traditional,
|
||||
add
|
||||
|
Loading…
Reference in New Issue
Block a user