diff options
author | Michał Gołębiowski <m.goleb@gmail.com> | 2015-09-07 23:22:56 +0200 |
---|---|---|
committer | Michał Gołębiowski <m.goleb@gmail.com> | 2015-09-07 23:22:56 +0200 |
commit | 14c0fe44328f22debb5b531d2b671923658542b3 (patch) | |
tree | e49a18a76ec5a377990f4da2a7ec2b05919a702c /src | |
parent | 3d7ce0a65f0707ff01a851822e57ba80adcff075 (diff) | |
download | jquery-14c0fe44328f22debb5b531d2b671923658542b3.tar.gz jquery-14c0fe44328f22debb5b531d2b671923658542b3.zip |
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 3d7ce0a65f0707ff01a851822e57ba80adcff075
Diffstat (limited to 'src')
-rw-r--r-- | src/serialize.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/serialize.js b/src/serialize.js index e0839dc09..94698fc2f 100644 --- a/src/serialize.js +++ b/src/serialize.js @@ -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 |