using focus function with jquery live -


i have page in can use jquery focus function using live...

$(".comment_text_class").live('focus', function() {    //do something... }); 

but when comes page(ajax loading) focus function doesn't work

as should using live function...

as suggested used focusin function..

$(".comment_text_class").live('focusin', function() {    //do something... }); 

but still new elements not have behavior...

also want hide using live function doesn't work @ all..

even elements in page itself...

   $(".comment_button").live('hide', function(){}); 

is focus , hide function implemented @ jquery 1.4.2 or bug...
because live focus not working jquery 1.4 version...

well page here... http://pradyut.dyndns.org/webapplicationsecurity/newuser.jsp?id=2

sorry .. fixed out...

please help...

thanks

pradyut
india

.live() doesn't work think believe. doesn't watch new elements , execute code, rather waits or events bubble , acts upon them if trigger element matches selector.

.live('focus') , .live('blur') work in jquery 1.4.1+, use focusin , focusout events in 1.4.0.

as hide, that's not event. if you're hiding comments they're added, seems css better approach, this:

.comment_button { display: none; } 

alternatively can use .livequery() plugin this:

$(".comment_button").livequery(function(){ $(this).hide(); }); 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -