From 5b43f2e36f7ed81a7c3f8266a5f3db29e7722884 Mon Sep 17 00:00:00 2001
From: James Addison
Date: Tue, 5 May 2020 13:02:01 +0100
Subject: [PATCH] jQuery.param: Document standaloneKeys argument
---
entries/jQuery.param.xml | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/entries/jQuery.param.xml b/entries/jQuery.param.xml
index 9a80fc2b..bcec5563 100644
--- a/entries/jQuery.param.xml
+++ b/entries/jQuery.param.xml
@@ -21,6 +21,9 @@
A Boolean indicating whether to perform a traditional "shallow" serialization.
+
+ A Boolean indicating whether to use abbreviated serialization of keys with null values
+
Create a serialized representation of an array, a plain object, or a jQuery object suitable for use in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input elements with name/value properties.
@@ -87,6 +90,16 @@ alert( shallowDecoded );
a=[object+Object]&b=1&b=2&b=3
+ To abbreviate the serialization of keys with null values, we can set the standaloneKeys
argument to true
+
+var myObject = {
+ x: 1,
+ y: null
+};
+var abbreviatedSerialization = $.param( myObject, false, true );
+
+alert( abbreviatedSerialization );
+
Serialize a key/value object.