jQuery param() method is used to create a serialized representation of an object.
Syntax:
$.param(obj, val)
Find more jquery interview questions and answers
jQuery param() method is used to create a serialized representation of an object.
Syntax:
$.param(obj, val)
Find more jquery interview questions and answers
The param() method creates a serialized representation of an array or an object.
Example 1
$(document).ready(function(){personObj = new Object();personObj.firstname = "yogesh";personObj.lastname = "hadiya";personObj.age = 21;$("button").click(function(){console.log($.param(personObj))});});
if you run example 1 then you will find output like below :
firstname=yogesh&lastname=hadiya&age=21
Example 2
$(document).ready(function(){personObj = new Object();personObj.firstname = "yogesh";personObj.lastname = "hadiya";personObj.age = 21;$("button").click(function(){console.log(personObj)});});
if you run example 2 then you will find output like below :
{firstname: “yogesh”, lastname: “hadiya”, age: 21}