In your original code sample, you appear to declare comments outside of your reply function. Try moving it inside the reply function, or passing the comments TO the reply function as a parameter from the Request.Html.onSuccess function.
Eric On May 19, 7:33 am, hamburger <[email protected]> wrote: > if i copy the complete function in here: > > onSuccess: function(){ > complete function reply ... > > it works > sometimes i understand nothing .. > > On 19 Mai, 13:18, hamburger <[email protected]> wrote: > > > > > ken: that what i'am doing. > > > var datenHolen = new Request.HTML ({ > > url: url, > > method: 'post', > > update: $('comments-box'), > > useSpinner: true, > > spinnerOptions: { > > message: "bitte warten ..." > > }, > > onStart: function(){ > > }, > > onComplete: function() { > > //alert("complett"); > > }, > > onSuccess: function(){ > > reply(); > > }, > > onFailure: function(){ > > //alert("failure"); > > } > > }); > > > On 19 Mai, 12:38, ken <[email protected]> wrote: > > > > 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?- > > > > Zitierten Text ausblenden - > > > > - Zitierten Text anzeigen -- Zitierten Text ausblenden - > > > - Zitierten Text anzeigen -
