From 96c7cbc30e1db2f1dde4358795755e8d98f0728b Mon Sep 17 00:00:00 2001
From: Mateusz Starzec
+ * See: jQuery Docs */
+ def param(obj: js.Array[js.Any] | js.Object | JQuery, traditional: Boolean = js.native): String = js.native
+
/** Parses a string into an array of DOM nodes.
- * See: jQuery Docs */
+ * See: jQuery Docs */
def parseHTML(data: String, context: Element = js.native, keepScripts: Boolean = js.native): js.Array[Element] = js.native
/** Takes a well-formed JSON string and returns the resulting JavaScript value.
- * See: jQuery Docs */
+ * See: jQuery Docs */
@deprecated("Since all the browsers supported by jQuery 3.0 support the native JSON.parse() method, we are deprecating jQuery.parseJSON().", "1.1.0")
def parseJSON(json: String): js.Any = js.native
/** Parses a string into an XML document.
- * See: jQuery Docs */
+ * See: jQuery Docs */
def parseXML(xml: String): js.Dynamic = js.native
/** Load data from the server using a HTTP POST request.
diff --git a/src/test/scala/io/udash/wrappers/jquery_test/MiscellaneousTest.scala b/src/test/scala/io/udash/wrappers/jquery_test/MiscellaneousTest.scala
index c2630c7..95b3953 100644
--- a/src/test/scala/io/udash/wrappers/jquery_test/MiscellaneousTest.scala
+++ b/src/test/scala/io/udash/wrappers/jquery_test/MiscellaneousTest.scala
@@ -43,6 +43,11 @@ class MiscellaneousTest extends WordSpec with Matchers {
selection.index(jQ(el3)) should be(2)
selection.index(el4) should be(-1)
}
+
+ "serialize objects to URL query string" in {
+ import scala.scalajs.js, js.JSConverters._
+ jQ.param(js.Dynamic.literal("a" -> Seq(1, 2, 3).toJSArray, "b" -> "c")) should be("a%5B%5D=1&a%5B%5D=2&a%5B%5D=3&b=c")
+ }
}
}