[Posted to jquery-dev 
http://groups.google.com/group/jquery-dev/msg/c33c84a2db495f88
and then realized that it may get better response here]

    I'm trying to register a simple plugin with livequery, but it
doesn't work as expected.

Code snippet:

$.fn.confirm = function() {
    this.click(function() {
        return window.confirm("Are you sure you want to " +
this.innerHTML.toLowerCase() + "?");
    });

};

if ($.livequery) {
    $.livequery.registerPlugin('confirm');

}

Testing:

<p><a href="#" class="delete">Delete</a></p>
<p><a href="#" class="ajax">Ajax apend</a></p>

jQuery(document).ready(function($) {
    $('a.delete').confirm();
    $('a.ajax').click(function(){
        $(this).parent().append('<p><a href="#"
class="delete">Delete</
a></p>');
        return false;
    });

});

     Any idea, why it's not working? TIA

--
  <?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com    Blog: http://rajeshanbiah.blogspot.com/

Reply via email to