title: Jquery Live click function doesn't work
body: <p>I have got a problem with Jquery live function. I am adding data dynamically so I have to use live function in order to get clicked a element which added dynamically.</p>
  <pre><code>$(&quot;a.pm_member&quot;).live(&quot;click&quot;, function(){
      alert('clicked');
  });
  </code></pre>
  <p>Data is added correctly. There are no error messages but it doesn't display alert window.</p>
  <p>I will be glad if anyone could help me out with this problem.</p>
  <p><strong>Edit:</strong></p>
  <p>I would like to give more details.</p>
  <p>This is what I use in the page;</p>
  <pre><code>&lt;script&gt;
  new TINY.editor.edit('editor',{
      id:'tiny_input',
      height:200,
      cssclass:'te',
      controlclass:'tecontrol',
      rowclass:'teheader',
      dividerclass:'tedivider',
      controls:['bold','italic','underline','strikethrough','|','subscript','superscript','|',
                'orderedlist','unorderedlist','|','outdent','indent','|','leftalign',
                'centeralign','rightalign','blockjustify','|','unformat','|','undo','redo','n','image','hr','link','unlink','|','cut','copy','paste','print','|','font','size','style'],
      footer:false,
      fonts:['Arial','Verdana','Georgia','Trebuchet MS'],
      xhtml:true,
      cssfile:'style.css',
      bodyid:'editor',
      footerclass:'tefooter',
      toggle:{text:'source',activetext:'wysiwyg',cssclass:'toggler'},
      resize:{cssclass:'resize'}
  });
  
  $('button#post').click(function () {
      editor.post();
  });
  
  $('#suggestions').hide();
  
  function hideSuggestions () {
      $('#suggestions').hide();
  }
  
  $(&quot;a.pm_member&quot;).live(&quot;click&quot;, function(){
      alert('clicked');
  });
  &lt;/script&gt;
  </code></pre>
  <p>This is a PM system. When admin writes a username in receiver input area, script is suggesting some usernames.</p>
  <pre><code>&lt;input type=&quot;text&quot; name=&quot;userName&quot; class=&quot;medium&quot; maxlength=&quot;100&quot; onkeyup=&quot;findMember(this.value);&quot; onblur=&quot;hideSuggestions();&quot; onfocus=&quot;findMember(this.value);&quot;/&gt;
  &lt;div id=&quot;suggestions&quot;&gt;&lt;/div&gt;
  </code></pre>
  <p>There are more than 1 page included in index.php. I can use .live() function without any problem in any other page but not in send-pm.php.</p>
  <p>I am quite confused how to debug it and how to solve it.</p>
  <p>.bind(), .live(), .find() it just doesn't work.</p>
  <p>Following elements are dynamically added;</p>
  <pre><code>&lt;div class=&quot;flat_area grid_8 searchresults&quot;&gt;
  &lt;h2 class=&quot;box_head grad_colour round_top&quot;&gt;Member Suggestions&lt;/h2&gt;
  &lt;div class=&quot;block&quot;&gt;
  &lt;ul class=&quot;full_width&quot;&gt;
  &lt;li&gt;
  &lt;strong&gt;Username: &lt;/strong&gt; &lt;a href=&quot;#&quot; id=&quot;{$found-&gt;id}&quot; class=&quot;pm_member&quot;&gt;{$found-&gt;username}&lt;/a&gt;&lt;br /&gt;
  &lt;strong&gt;Full Name: &lt;/strong&gt; {$found-&gt;fullName}&lt;br /&gt; 
  &lt;strong&gt;Email: &lt;/strong&gt;{$email}
  &lt;/li&gt;
  &lt;li&gt;Total &lt;strong&gt;{$totalRecords}&lt;/strong&gt; records found.&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Any ideas how to debug it?</p>
  <p><strong>EDIT 2:</strong></p>
  <p>I even tried to add following code between  element just right after adding jquery and jquery ui files.</p>
  <pre><code>&lt;!-- Load JQuery --&gt;        
  &lt;script type=&quot;text/javascript&quot; src=&quot;includes/js/jquery-1.5.1.min.js&quot;&gt;&lt;/script&gt;
  &lt;!-- Load JQuery UI --&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;includes/js/jquery-ui-1.8.11.custom.min.js&quot;&gt;&lt;/script&gt;
  &lt;script&gt;
  $(document).ready(function() {
      $(&quot;a.pm_member&quot;).live(&quot;click&quot;, function(){
          alert('clicked');
      });
  });
  &lt;/script&gt;
  </code></pre>
  <p>If this would be about some Jquery code braking it, shouldn't that fix it (I am not that good with Jquery though).</p>
  <p><strong>EDIT 3:</strong></p>
  <p>My function to find members</p>
  <pre><code>function findMember (inputString) {
      if(inputString.length == 0) {
        $('#suggestions').fadeOut(); // Hide the suggestions box
     } else {
        $.get(siteUrl + &quot;includes/ajax/profile.php?do=find-member&quot;, {username: &quot;&quot;+inputString+&quot;&quot;}, function(data) { // Do an AJAX call
           $('#suggestions').fadeIn(); // Show the suggestions box
           $('#suggestions').html(data); // Fill the suggestions box
        });
     }
   }
  </code></pre>
  <p>Once again, thank you for your help and concern.</p>