while this might keep the browser from crashing, I wonder what values these parameters will have, when the event finally occurs. The ones I have passed the very first time? I thought they would have been destroyed by then, as we left this scope long ago ... But I'll try it out :), thanks!
On Sat, Dec 13, 2008 at 3:22 AM, Mike Nichols <nichols.mik...@gmail.com> wrote: > > Try this: > success: function() { registerImageForms(id,key,type); } > > > On Dec 12, 5:13 pm, "Jan Limpens" <jan.limp...@gmail.com> wrote: >> Hello, >> >> I have the following code: >> >> var registerImageForms = function(id, key, type) { >> var sizes = ['small', 'medium', 'large']; >> $('#panel-images fieldset:visible').remove(); >> $.each(sizes, function(i, item) { >> var $clonedForm = $('#panel-images fieldset:hidden').clone(); >> $("legend", $clonedForm).text(item); >> $("[name='id']", $clonedForm).val(id); >> $("[name='key']", $clonedForm).val(key); >> $("[name='type']", $clonedForm).val(type); >> $("[name='size']", $clonedForm).val(item); >> $("img", $clonedForm).attr('src', "/imagem/article/" + key + >> "/" + item + ".png"); >> $("#panel-images").append($clonedForm); >> $("form", $clonedForm).ajaxForm({ >> success: registerImageForms >> }); >> $clonedForm.show(); >> }); >> >> }; >> >> Success has no args, so everything is rendered empty, after posting >> the form. If I pass arguments as >> success: registerImageForms(id, key, type) >> >> The browser crashes and it makes sense, because at the time this >> fires, these identifiers mean nothing. But how do I pass them? >> >> -- >> Jan -- Jan