title: Pass nested object in jquery ajax
body: <p>I want to pass following nested object in ajax using jquery:</p>
  
  <pre><code>{
     "parent_param1" : [
        {
           "sub_param1" : "sub_val1",
           "sub_param2" : "sub_val2"
        },
        {
           "sub_param1" : "sub_val1",
           "sub_param2" : "sub_val2"
        },
        {
           "sub_param1" : "sub_val1",
           "sub_param2" : "sub_val2"
        }
     ],
     "parent_param2" : "par_val2",
     "parent_param3" : "par_val3"
  }
  </code></pre>
  
  <p>I'm trying to pass it like following example:</p>
  
  <pre><code>var url = encodedURL;
  var data = 'Above Object';
  
  $.ajax({            
      type:'POST',
      url:url,
      dataType:'json',
      data:data,
          success:function(res){                      
                alert('success');                         
      },
      error:function(e){
        alert('error');   
      }                   
  });
  </code></pre>
  
  <p>I'm getting runtime error as response. I want to make sure that Is that correct way to pass nested object in AJAX using jQuery?</p>