jquery param method

the jquery.param() method is used to create a serialized representation of an array or object,it used in a url query string or ajax request.

the jquery param method syntax :-

         $(selector.param ( object,  traditional )
parameterdescription
objectrequired.indicate an array or object to serialize.
traditionaloptional.boolean value indicating whether to perform a traditional 'shallow' serialization'.

the jquery param method example

               <script>
           
                   $(document).ready(function(){
                   
                   var user =new Object();
                   
                   user.firstName="sandeep";
                   
                   user.lastName="nehra";
                   
                   user.fatherName="chri chand nehra";
                   
                   user.age=25;
                   
                   $("button").click(function(event){
                   
                   $("div").html($.param(user));
                   
                          });  }); 
                          
            </script>