1

Using jquery, all of my other livequery functions work fine, i am getting an error for this particular one...

$("[class*='welcome']").livequery("click", function(e){   etc.......

The error is:

Uncaught TypeError: Object #<Object> has no method 'livequery' 

is it because of the wildcard? or a general jquery error?

Thank you

brian wilson
  • 497
  • 1
  • 7
  • 15

1 Answers1

7

If what you want to do is

Attach an event handler for all elements which match the current selector, now and in the future

Then this is the appropriate syntax:

$(document).on("click", "[class*='welcome']", function() {
    // do stuff
});

jQuery's live() function used to be the way to go, but it has been deprecated in favor of on() as of jQuery 1.7.

Demo here: http://jsfiddle.net/zNXXk/

Ayman Safadi
  • 11,502
  • 1
  • 27
  • 41