Yes I have also been having issues with this. where click events do not fire
even though the ID exists.

thanks. i thin the .live() or .bind() should work.

2009/6/3 Gustavo Salomé <gustavon...@gmail.com>

> Check the jquery live function
> http://docs.jquery.com/Events/live
> I think it is what you are looking for.
>
> 2009/6/3 Cod <c...@pdx.pl>
>
>
>> Hi guys. I hope you can help me with my little problem with jQuery.
>>
>> I'd like to do something like this:
>>
>> After the page is loaded I have some forms with submit buttons. The
>> buttons have a class called "open". By clicking any of these buttons
>> the script is using AJAX to take some data from database and add some
>> HTML to the document. This part of generated HTML has also buttons
>> with a class "open". By clicking any of the new buttons script should
>> do what it does with the old ones. The problem is I have no idea how
>> to "refresh" a click function. After generating HTML it "sees" only
>> the old buttons.
>>
>> Here's some code:
>>
>> $(document).ready(function(){
>>        $(".open").click(function(){
>>                var idVal =
>> $(this).parent().parent().find("#PlaceId").val();
>>                if($("#admin_places_"+idVal).html()=='')
>>                {
>>                        $(this).attr('value', 'Zwiń >>');
>>                        $.post("/places/open/"+idVal, null ,
>>                                                function(data){
>>                                $("#admin_places_"+idVal).html(data);
>>                                                }
>>                                 );
>>                }
>>                else
>>                {
>>                        $("#admin_places_"+idVal).html('');
>>                        $(this).attr('value', 'Rozwiń >>');
>>                }
>>                return false;
>>        });
>> });
>>
>> Thanks in advance for helping me.
>>
>
>
>
> --
> Gustavo Salome Silva
>

Reply via email to