title: Parsing associative array via AJAX
body: <p>I have the following associative array and i try to send it to the server via AJAX.</p>
  
  <p>Checking my console, in the network tab, it's posted but nothing is parsed.</p>
  
  <p><strong>Array creation:</strong></p>
  
  <pre><code>   var FiltersArray = [];
  
      FiltersArray['category'] = this.category.val(); 
      FiltersArray['Type1'] = this.type1.val(); 
      FiltersArray['Type2'] = this.type2.val(); 
  </code></pre>
  
  <p><strong>Assoc array (console.log):</strong></p>
  
  <p><code>[category: "6", Type1: "998", Type2: "20100100"]</code></p>
  
  <p><strong>Request:</strong></p>
  
  <pre><code>$.ajax({
      type: POST,
      url: 'something.php',
      data: {
          data: FiltersArray 
      }
  }).done(function(data) {
      console.log('Server Response: ' + data);
  })
  </code></pre>
  
  <p>Complete code:</p>
  
  <pre><code>          $(document).ready(function() {
      var filters = {
          category: $("#categoryInp"),
          type1: $("#type1Inp"),
          type2: $("#type2Inp"),
          button: $("#FilterBtn"),
  
          returnArray: function() {
              var FiltersArray = [];
  
              FiltersArray['category'] = this.category.val();
              FiltersArray['Type1'] = this.type1.val();
              FiltersArray['Type2'] = this.type2.val();
  
              return FiltersArray;
          },
          sendRequest: function(type, URL) {
              $.ajax({
                  type: type,
                  url: URL,
                  data: JSON.stringify(this.returnArray()),
  
                  beforeSend: function() {}
  
              }).done(function(data) {
                  console.log('Server Response: ' + data);
              }).fail(function() {
                  alert("An error occurred!");
              });
          }
      };
  
      filters.button.on('click', e =&gt; {
          console.log(filters.returnArray());
          filters.sendRequest('POST', 'Modules/Products.order.module.php');
      });
  
  });
  </code></pre>