On 1/23/07, claypipe <[EMAIL PROTECTED]> wrote: > > ___Newbie (with Mochikit) warning___ > > I am asynchronously updateing a page. > > I create a "div" element divnode. Then I want to add content to this. > > I have found that if I do > newelement1 = ... > newelement2 = ... > newelement3 = ... > > appendChildNodes(divnode,newelement1, newelement2, newelement3); > swapDOM(targetnode, divnode); > > it behaves nicely. > > If I do > newelement1 = ... > appendChildNodes(divnode,newelement1); > newelement2 = ... > appendChildNodes(divnode,newelement2); > newelement3 = ... > appendChildNodes(divnode,newelement3); > swapDOM(targetnode, divnode); > > It does something, but the new elements do not appear.
There must be something more to it, I tried running this in the interpreter: var divnode = DIV(); var el1 = SPAN(null, '1'); var el2 = SPAN(null, '2'); var el3 = SPAN(null, '3'); appendChildNodes(divnode, el1, el2, el3); writeln(toHTML(divnode)); var divnode = DIV(); var el1 = SPAN(null, '1'); appendChildNodes(divnode, el1); var el2 = SPAN(null, '2'); appendChildNodes(divnode, el2); var el3 = SPAN(null, '3'); appendChildNodes(divnode, el3); writeln(toHTML(divnode)); Both blocks give identical results. It will help, as Bob said, if you are able to reproduce this in a complete code example. Arnar --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MochiKit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~----------~----~----~----~------~----~------~--~---
