title: jquery Post , data object
body: <p>I try to understand one thing.</p>
  
  <p>I want to post an object with jquery Ajax POST , something like this:</p>
  
  <pre><code>var dataPostYear = {
      viewType:GetViewType(),
      viewDate:'2009/09/08',
      languageId:GetLanguageId()
  };
  
  
   $.ajax({
     type: "POST",
     url: url,
     data: dataPostYear,
     contentType: "application/json; charset=utf-8",
     dataType: "json",
     success: OnLoadYearListSuccess,
     error: OnLoadYearListError  
    });
  </code></pre>
  
  <p>and it doesn't work.</p>
  
  <p>But this one works fine:</p>
  
  <pre><code>var dataPostYear = "{viewType:'"+ GetViewType() + "',viewDate:'2009/09/08',languageId:'"+GetLanguageId()+"}";
  
   $.ajax({
     type: "POST",
     url: url,
     data: dataPostYear,
     contentType: "application/json; charset=utf-8",
     dataType: "json",
     success: OnLoadYearListSuccess,
     error: OnLoadYearListError  
    });
  </code></pre>
  
  <p>GetViewType() return --'0'
  languageId()  return --'1'</p>
  
  <p>it's just a string</p>
  
  <p>there is a way to post an object, something what I try to do in my first way ? Or not ?</p>
  
  <p>Thanks </p>