title: jQuery click() not working on replaced html
body: <p>I am trying to create a <a href="http://en.wikipedia.org/wiki/Five_in_a_Row_%28game%29" rel="nofollow noreferrer">go-moku</a> game using jquery,php, and mysql database.
  I have a ajax function that updates the a board every second if needed.</p>
  
  <pre><code>var turnCount = -1;
  setInterval(function(){
      $.get('includes/boardControl.php',{turn: turnCount }, function(data){
          if(data != "")
          {   $("#board").html(data);
              turnCount = $("#turnCount").text();
              $("#turnCount").text("")
          }
      });
  
  }, 1000);
  </code></pre>
  
  <p>This works just fine, it checks the database to see if turn has been incremented and replaces the board if it has.  Now what I want to ultimately do is create a click function that use Ajax to update the board and turn count in the database.  I am hoping to somehow use the N'th selector do determine what square I'm clicking on.</p>
  
  <p>I have several questions.</p>
  
  <p><strong>1)</strong> My click function right now is</p>
  
  <pre><code>$(document).ready(function() {
      $("td &gt; img").click(function(){
          alert("clicked");
      });
  });
  </code></pre>
  
  <p>as of right now it works on a extra test table I wrote into the html, but not on the table created with the previous function.  What am I doing wrong?</p>
  
  <p><strong>2)</strong> The tutorials I've looked at so far dictate that I should write code in the following way.</p>
  
  <pre><code>$(document).ready(function() {
    //code here
  });
  </code></pre>
  
  <p>When i asked a question last night, I was told that I was over complicating things with my functions.  So when should i use a document.ready function and when not?  And is it fine to put all of my scripts into one document.ready function or should I have multiple?</p>
  
  <p><strong>3)</strong>
  Once I get the click image to work I am hoping to send a X,Y coordinate to the server and change that corresponding spot on the board.  How would I determine what cell in the table is clicked in order to know what coordinates to use?  (or is there a much easier way?)</p>