I have a page in which i can successfully use the jquery focus function using live…
$(".comment_text_class").live('focus',
function() {
//do something...
});
but when something comes into the page(ajax loading) the focus function doesn’t work
as should be using the live function…
as suggested i used focusin function..
$(".comment_text_class").live('focusin',
function() {
//do something...
});
but still new elements do not have the behavior…
also i want to hide something using the live function but it doesn’t work at all..
even for the elements in the page itself…
$(".comment_button").live('hide', function(){});
is the focus and hide function implemented at all by jquery 1.4.2 or is it a bug…
because the live focus was not working with jquery 1.4 version…
well the page here… http://pradyut.dyndns.org/WebApplicationSecurity/newuser.jsp?id=2
sorry .. fixed it out…
Please help…
thanks
Pradyut
India
.live()doesn’t work like you think I believe. It doesn’t watch for new elements and execute code, rather it waits or events to bubble up and acts upon them if the trigger element matches the selector..live('focus')and.live('blur')work in jQuery 1.4.1+, however you could use thefocusinandfocusoutevents in 1.4.0.As for the
hide, that’s not an event. If you’re hiding all comments as soon as they’re added, it seems like CSS is a better approach, like this:Alternatively you can use the
.livequery()plugin like this: