title: how to send multiple data with $.ajax() jquery
body: <p>i am trying to send multiple data using j query $.ajax method to my php script but i can pass only single data when i concatenate multiple data i get undefined index error in my php script tat means the ajax request is made but data is not sent i need to know how should i format multiple data to successively send it to processing script in name vale pair here is what i have written</p>
  
  <pre><code>&lt;script&gt;
    $(document).ready(function() {
  
      $('#add').click(function () {
  
        var name = $('#add').attr("data_id");
  
        var id = $('#add').attr("uid");
  
        var data = 'id='+ id  &amp; 'name='+ name; // this where i add multiple data using  ' &amp; '
  
        $.ajax({
          type:"GET",
          cache:false,
          url:"welcome.php",
          data:data,    // multiple data sent using ajax
          success: function (html) {
  
            $('#add').val('data sent sent');
            $('#msg').html(html);
          }
        });
        return false;
      });
    });
  &lt;/script&gt;
  
  
  
  &lt;span&gt;
    &lt;input type="button" class="gray_button" value="send data" id="add" data_id="1234" uid="4567" /&gt;
  &lt;/span&gt;
  &lt;span id="msg"&gt;&lt;/span&gt;
  </code></pre>