Events get lost after ajax. live() won't work

Events get lost after ajax. live() won't work

Hi

  1. (function ($) {
  2.    $.test = {
  3.       main: function (){
  4.          // Shortcut
  5.          $this = $(this[0]);
  6.      
  7.          // $this.live('click', function()... is not working!
  8.          // $this.bind('click', function()... is working!
  9.         $this.live('click', function(){  
  10.                
  11.                 // Don't work, when element is new inserted by ajax.
  12.               alert("klick!");
  13.         });
  14.       }
  15.    }
  16.    $.fn.myTest = $.test.main;
  17. })(jQuery);
  18. $(function() {
  19.  
  20.   $("#blah").myTest();
  21.  
  22. });

When I reload the link <a id="blah" ... with ajax
then the click event get's lost.

So I tried with live().
But live() won't work.

Why?

Thanks for any help!