title: How to pass an array through $.get?
body: <p>I have the following code:</p>
  
  <pre><code>var social_buttons_array = [];
  social_buttons_array["google"] = $("input[name='social_popup_google']").is(":checked") ? 1 : 0;
  social_buttons_array["twitter"] = $("input[name='social_popup_twitter']").is(":checked") ? 1 : 0;
  social_buttons_array["twitter_follow"] = $("input[name='social_popup_twitter_follow']").is(":checked") ? 1 : 0;
  social_buttons_array["facebook"] = $("input[name='social_popup_facebook']").is(":checked") ? 1 : 0;
  </code></pre>
  
  <p>And I am trying to pass the array like this:</p>
  
  <pre><code>$.get(
      ajaxurl,
      {
          action: 'process_data',
          get: 'social_popup',
          social_buttons_array : social_buttons_array // not works
      },
      function(response) {
      },
      'json'
      );
  </code></pre>
  
  <p>This do not works. Any idea to pass the array?</p>
  
  <hr>
  
  <p><strong>EDIT &amp;&amp; solution</strong></p>
  
  <p>I edit this question to replace the <code>associative array</code> by an object that will act as an array.</p>
  
  <pre><code>var social_buttons_array = new Object();
  social_buttons_array.google = $("input[name='social_popup_google']").is(":checked") ? 1 : 0;
  social_buttons_array.twitter = $("input[name='social_popup_twitter']").is(":checked") ? 1 : 0;
  social_buttons_array.twitter_follow = $("input[name='social_popup_twitter_follow']").is(":checked") ? 1 : 0;
  social_buttons_array.facebook = $("input[name='social_popup_facebook']").is(":checked") ? 1 : 0;
  
  $.get(
      ajaxurl,
      {
          action: 'process_data',
          get: 'social_popup',
          social_buttons_array : JSON.stringify(social_buttons_array) // it works great over an object
      },
      function(response) {
      },
      'json'
      );
  </code></pre>
  
  <p>To manage this array/object in php we need:</p>
  
  <pre><code>$social_buttons_array = json_decode(stripslashes($_GET['social_buttons_array']));
  </code></pre>
  
  <p>And then we must manage this var as an object:</p>
  
  <pre><code>echo $social_buttons_array-&gt;google
  // results in 1 or 0
  </code></pre>