English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
$ .param() method creates a serialized representation of an array or an object.
When making an AJAX request, you can use serialized values in the URL query string.
$.param(obj, traditional)
Output the result of serializing the object:
myObj = new Object(); myObj.firstname = "Seagull"; myObj.lastname = "Anna"; $("button").click(function(){ $("p").text($.param(myObj)); });Test and see‹/›
Serialized Key/Value Object:
let myObj = {width:300, height:250}; let str = $.param(myObj); $("button").click(function(){ $("p").text(str); });Test and see‹/›
Name | Description |
---|---|
obj | Specify the array, object, or jQuery object to be serialized |
traditional | (Optional) Boolean value indicating whether to perform traditional 'shallow' serialization |