title: jQuery call with ajax not responding, no error
body: <p>I have a small problem with a giftlist generated from SQL. My goal is to echo each row as a form with a textbox and a button, then when any button clicked, pass the textbox value, and an id number (hidden field value) to a function. Then this function would have get the values, and sends them with AJAX get method to a php, which would update a row with the giver's name in the SQL database. I cannot find the error in my code, so please help me in this regard.</p>
  
  <p><em>EDIT:</em> i need to figure out too, how to identify the button which was clicked.</p>
  
  <p>This would be my script:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          var aname = '';
          var tid = 0;
          $('.giftok').click(function()
          {
              if ($('.aname').val() === '')
              {
                  alert('You have not provided your name.');
              }
              else
              {
                  aname = $('.aname').val();
                  tid = $('.id').val();
  
                  $.ajax
                  ({
                  url: "kosarba.php",
                  data: { ganame: aname, tid: gtid },
                  type: "GET",
                  context: document.body
                  }).done(function() {
                      alert("OK, it works.");
                  });
  
                  alert('Thank you!');
              }
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>Here is my HTML+PHP:</p>
  
  <pre><code>echo "&lt;table id='giftlist' align='center' font-size='10pt'&gt;";
  while($sor=mysql_fetch_array($sordb))
      {
          echo "&lt;tr&gt;
                  &lt;td width='420px'&gt;$sor[gname]&lt;/td&gt;
                  &lt;td width='65px'&gt;$sor[gprice] Ft&lt;/td&gt;";
          if (strlen($sor[aname]) !== 0)
              {
                  echo "&lt;td width='200px'&gt;Sorry, someone already bought this one for us.&lt;/td&gt;";
              }
          else
              {
                  echo "&lt;td width='335px'&gt;&lt;form id='rendelget'&gt;Your name: &lt;input type='textbox' id='aname' name='aname' value='$aname'/&gt;&lt;input type='hidden' class='id' name='id' value='$sor[id]'/&gt;&amp;nbsp;&lt;button type='button' id='$sor[id]' class='giftok' value='Megveszem'&gt;Megveszem&lt;/button&gt;&lt;/form&gt; &lt;/td&gt;";
              }
          echo "&lt;/tr&gt;";
      }
  echo "&lt;/table&gt;";
  </code></pre>