Element#replace may be what you are looking for. Allen Madsen http://www.allenmadsen.com
On Sat, Jul 3, 2010 at 6:00 AM, Viktor Kojouharov <vkojouha...@gmail.com> wrote: > I understand that. And I was using update to clear the container and > add a new element. My problem was, I have a reference to the previous > element of the container that was just cleared, and I am saving that > reference of the element with the intention of replacing the new > container content with that element at some future time. Right now I'm > using innerHTML = '', since using Element#update would wipe out the > storage of the element I have a reference to, and that is highly > undesirable. > > On Jul 2, 3:16 pm, "joe t." <thooke...@gmail.com> wrote: >> Most people interpret it to mean "update with new content". Think >> along the lines of a page refresh for just that element: wipe out the >> existing content, update with new. Some others like yourself expect it >> to mean "append with new content". That approach is handled by >> Element#insert: preserve existing content, place new content at the >> desired Position (usually appended, but insertion options are >> available). >> >> http://api.prototypejs.org/dom/element/insert/ >> >> This same question came up some months ago. Hopefully that >> clarification helps. >> -joe t. >> >> On Jul 2, 5:24 am, Viktor Kojouharov <vkojouha...@gmail.com> wrote: >> >> >> >> > This behaviour is a bit unexpected, and caused some debugging time to >> > figure out why some elements were losing their storage. Why isn't this >> > only done during page unload? > > -- > You received this message because you are subscribed to the Google Groups > "Prototype: Core" group. > To post to this group, send email to prototype-core@googlegroups.com > To unsubscribe from this group, send email to > prototype-core-unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/prototype-core?hl=en -- You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en