1.

What Is The Use Of Param() Method?

Answer»
  • The param() method is used to represent an ARRAY or an object in serialize manner.
  • While making an ajax request we can USE these serialize values in the QUERY STRINGS of URL.
  • SYNTAX: $.param(object | array, boolValue) • “object | array” specifies an array or an object to be serialized.
  • “boolValue” specifies whether to use the traditional style of param serialization or not.
  • For example:
personObj=new Object();
empObject.name="Arpit";
empObject.age="24";
empObject.dept=”IT”;
$("#clickme").click(function(){
$("span").text($.param(empObject));
});

It will set the text of span to “name=Arpit&age=24&dep=IT”

It will set the text of span to “name=Arpit&age=24&dep=IT”



Discussion

No Comment Found