I am writing a plugin and need to live bind a click. The plugin works fine when I do a normal click bind, but not a live bind.
I've boiled the plugin down to the basics:
- (function($) {
- $.fn.liveBindTest = function() {
- return this.each(function() {
- $(this).live('click', function(){
- console.log('live click');
- return false;
- });
- $(this).click(function(){
- console.log('click');
- return false;
- });
- });
- };
- })(jQuery);
When I call the plugin function on a link, only click
is printed to my console.
What must I do in order for live()
to work? Thanks.