title: add data into dataString and pass it into ajax data
body: <pre><code>&lt;script&gt;    
  $(document).ready(function(){
      $(".check").click(function(){
          $("input:checkbox[class=check]:checked").each(function () {
              //alert($(this).val());
              //alert($(this).attr("id"));
              var key = $(this).val();
              var value = $(this).attr("id");
              alert(key'='+value);
  
              //alert(value); 
              //var dataString = key='+'value;
              //alert(dataString);
  
          });
          //alert(dataString);
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Shown above is my code and I want to pass a string into ajax data in the format of key=value and receive it into php $_POST['key'] variable </p>
  
  <pre><code>$.ajax({
  type: "POST",
  url: url,
  data: dataString,
  cache: false,
  dataType: "html",
  </code></pre>
  
  <p>Please anybody tell me how I can do this. The problem is concatenating data into dataString too.</p>