title: Append multiple variables(params) to url for ajax call
body: <p>I am trying to append values from a <code>checked</code> checkbox to a url that later would be used for an ajax call. As mentioned I would only like to have the values appended to the <code>url</code> if checkbox is checked. If a user checks and then unchecks, this would indicate not to add the value to the url. Below I have some basic foundation code. How can I append multiple items to the url ?</p>
  
  <pre><code>&lt;form&gt;
  &lt;input type="checkbox" value="1" id="item1" /&gt;
  &lt;input type="checkbox" value="2" id="item2" /&gt;
  &lt;input type="checkbox" value="3" id="item3" /&gt;
  &lt;input type="submit" id="submitForm" value="Submit Form" /&gt;
  &lt;form&gt;
  
  &lt;script&gt;
  $('#submitForm').click(function() {
      $('checkbox').click(function() {
      $.getJSON('www.mysite.com/mypage.php?id='+item1+item2+item3)
      });
  });
  &lt;/script&gt;
  </code></pre>