The Jquery.param () function is used to serialize a JS array or object into a string value, serialize the jquery object to a URL parameter according to Name/value or Key/value, and connect with &. For use in URL query strings or AJAX requests.
Grammar
$.param (Object,trad)
Parameter description
Object: Required. Specifies the array or object to serialize.
Trad: Optional. A Boolean value that specifies whether to use the traditional style of parameter serialization.
Instance
Var v1 = $.param ( true ); // "" Var v2 = $.param ( 100 ); // "" Var v3 = $.param ( 12.34 ); // "" var v4 = $.param ( "" ); // "" Var v5 = $.param ( function () { return 18; } ); // "" Var v6 = $.param ( /\\d+/ ); // "" Var v7 = $.param ( new date () ); // "" Var v8 = $.param ( null ); // error Var v9 = $.param ( undefined ); // error// string will be treated as a character array var v10 = $.param ( "name" ); // "0=n&1=a&2=m &3=e "Var v11 = $.param ( { name:" Codeplayer ", age:18 } ); // "name=codeplayer&age=18" var array = [ { name: "name" , value: "Zhang San" }, { name: "Age", value: 18, extra: "ignore this attribute" }, { name: "Grade" }, // without the Value property, the value is undefined and will be converted to an empty string "" { name: "OrderId", value: 2 }, { name: "OrderId", value: 3 },];var v12 = $.param ( array ); // "name=%e5%bc%a0%e4%b8%89&age=18&grade=&orderid=2&orderid=3"// jquery each element of an array as an object, and call its name and Value property// because these elements do not have the Name property, so for undefined, and to be converted to the string "undefined"// because these elements do not have the Value property, so for undefined, and is converted to an empty string "" Var v13 = $.param ( [ "name", 2, 3 ] ); // " Undefined=&undefined=&undefined= "
Reference: jquery param method http://www.studyofnet.com/news/933.html
Use of the jquery param () method