title: how to send JSON array through ajax?
body: <pre><code>var storeSettings = [];
  
                          obj.find(o_widgetClass).each(function(){
                              var storeSettingsStr          = {};
                              storeSettingsStr['id']        = $(this).attr('id');
                              storeSettingsStr['style']     = $(this).attr('data-widget-attstyle');
                              storeSettingsStr['title']     = $(this).children('header').children('h2').text();
                              storeSettingsStr['hidden']    = ($(this).is(':hidden') ? 1 : 0);
                              storeSettingsStr['collapsed'] = ($(this).hasClass('powerwidget-collapsed') ? 1 : 0);
                              storeSettings.push(storeSettingsStr);
                          }); 
  
                          var storeSettingsObj = JSON.stringify( {'widget':storeSettings} );
  
                          /* Place it in the storage(only if needed) */
                          if(getKeySettings != storeSettingsObj){
                              //alert(storeSettingsObj);
                              var memberfilter = new Array();
                              memberfilter[0] = "id";
                              memberfilter[1] = "style";
                              var jsonText = JSON.stringify(storeSettings, memberfilter);
  alert(jsonText);
  
  
     // it gives this result 
  [{"id":"widget1"},{"id":"widget3","style":"black"},{"id":"widget4"},{"id":"widget5"},{"id":"widget2","style":"black"},{"id":"widget6"},{"id":"widget7"},{"id":"widget9"},{"id":"widget8"},{"id":"widget10"},{"id":"widget12"},{"id":"widget13"},{"id":"widget11"},{"id":"widget14"}]
  </code></pre>
  
  <p>Now how can i send it through jquery ajax ? i am trying with the below mentioned code <strong>but not yet able to do get data on server</strong></p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: 'get_query.php',                      
      data: "test="+jsonText,
      success: function(data) {
          alert(data);
          }
  });
  </code></pre>
  
  <p><strong>So could you plz explain how to send and then how to get this data ?</strong> i have tried with json_decode but not working for me.</p>
  
  <p><strong>EDITED after xdazz comment to send it without stringify</strong></p>
  
  <p>Got this when i print_r($_POST['test'])</p>
  
  <pre><code>Array
  </code></pre>
  
  <p>(
      [0] => Array
          (
              [id] => widget1
              [title] => Hidden widget
              [hidden] => 1
              [collapsed] => 0
          )</p>
  
  <pre><code>[1] =&gt; Array
      (
          [id] =&gt; widget3
          [style] =&gt; red
          [title] =&gt; Icons
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  
  [2] =&gt; Array
      (
          [id] =&gt; widget4
          [style] =&gt; black
          [title] =&gt; No toggle button
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  
  [3] =&gt; Array
      (
          [id] =&gt; widget5
          [title] =&gt; No delete button
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  
  [4] =&gt; Array
      (
          [id] =&gt; widget6
          [title] =&gt; No edit button
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  
  [5] =&gt; Array
      (
          [id] =&gt; widget7
          [title] =&gt; Not fullscreen button
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  
  [6] =&gt; Array
      (
          [id] =&gt; widget9
          [title] =&gt; No custom button
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  
  [7] =&gt; Array
      (
          [id] =&gt; widget8
          [title] =&gt; Not sortable
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  
  [8] =&gt; Array
      (
          [id] =&gt; widget10
          [title] =&gt; Collapsed widget
          [hidden] =&gt; 0
          [collapsed] =&gt; 1
      )
  
  [9] =&gt; Array
      (
          [id] =&gt; widget12
          [title] =&gt; Auto refresh
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  
  [10] =&gt; Array
      (
          [id] =&gt; widget2
          [style] =&gt; black
          [title] =&gt; Basic widget
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  
  [11] =&gt; Array
      (
          [id] =&gt; widget13
          [title] =&gt; No timestamp
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  
  [12] =&gt; Array
      (
          [id] =&gt; widget11
          [title] =&gt; Ajax
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  
  [13] =&gt; Array
      (
          [id] =&gt; widget14
          [title] =&gt; No refresh button
          [hidden] =&gt; 0
          [collapsed] =&gt; 0
      )
  </code></pre>
  
  <p>)</p>