I’m sort of stuck with a simple problem. how can I attach a handler to an element(now and future)? for example, I have a selector ‘test’, I apply a plugin to it:
$('.test').handler();
but this does not apply to the content loaded via ajax later.
I know that I can use .on, but .on method must take an event name as the first argument, which I think I don’t have here. So is there an even name here or how do I solve this? thanks a lot.
The
livequeryplugin allows you to do this:http://brandonaaron.net/code/livequery/docs
This will apply the
hander()plugin to all current selectors, and future selectors