title: How can I convert query string or JSON object map to single JSON object with jQuery?
body: <p>For this example, assume that I have a list of months in a form, each with a checkbox next to them. I'm looking for help on doing either of two things:</p>
  
  <ol>
  <li>Convert a query string (e.g. <code>"January=on&amp;March=on&amp;September=on"</code>) or</li>
  <li>Convert an object map: <code>[{ January: 'on' },{ March: 'on' },{ September: 'on' }]</code> </li>
  </ol>
  
  <p>to a single JSON object: <code>{ January: 'on', March: 'on', September: 'on' }</code></p>
  
  <p>I realize that the first map is already JSON, but instead of the object array I'd like it to be a single JSON object. I can build the map with <code>$('form').serializeArray();</code> and I can build the query string with <code>$('form').serialize();</code>.</p>
  
  <p>The implementation of .serialize() in the jQuery API is simply:</p>
  
  <pre><code>serialize: function() {
      return jQuery.param(this.serializeArray());
  },
  </code></pre>
  
  <p>which is why I could handle either the first or second answer.</p>
  
  <p>The reason I'd like to do this is because I'm switching from PrototypeJS to jQuery, and in PrototypeJS this was as simple as:</p>
  
  <pre><code>Object.toJSON(Form.serializeElements($('myform'), true));
  </code></pre>
  
  <p>So, does anybody know of a JSON plug-in (I'd like to stick with ONLY jQuery) that could do this easily, or know of a simple method to achieve the result I'm looking for?  Thanks!</p>