you are probably calling reply() right after Request.HTML send. try
this...
new Request.HTML ({ ...
update: $('comments-box'), ..
onComplete: function() {
reply($$('.comment') );
}
On May 19, 6:35 pm, hamburger <[email protected]> wrote:
> Hello I have a problem to get an id after Request.HTML
>
> i'am doing a new Request.HTML ({ ...
> update: $('comments-box'), ..
>
> in the comment-box are a lot of diffs like
> <div id="comment-1029-x" class="comment">
>
> now i have a function to treat the diffs like
>
> var comments = $$('.comment')
> function reply() { alert(comments.length);
> if(comments.length) { ...
> var open = -1;
> comments.each(function(comment,i) {
> //add the "reply" link
> var el = new Element('a',{ ...
>
> but alert(comments.length); shows allways 0
>
> does it mean that i can't grab the html.content after an ajax call?