Events get lost after ajax. live() won't work
Hi
- (function ($) {
- $.test = {
- main: function (){
- // Shortcut
- $this = $(this[0]);
-
- // $this.live('click', function()... is not working!
- // $this.bind('click', function()... is working!
- $this.live('click', function(){
-
- // Don't work, when element is new inserted by ajax.
- alert("klick!");
- });
- }
- }
- $.fn.myTest = $.test.main;
- })(jQuery);
- $(function() {
-
- $("#blah").myTest();
-
- });
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!