You have to make the element twice because foo.innerHTML returns the
content _inside_ foo, so it doesn't include foo.
That extend stuff isn't from MochiKit, so I'd assume it's coming from
Prototype since they do some overloading of DOM stuff.
Easiest solution to me would be to just use MochiKit to insert the
element. The code would look like:
var new TR = TR(null, TD( /* ... */ ));
insertSiblingNodesAfter("row1.4", newTR);
would do the trick, if I'm not mistaken.
Another thing to point out is that you should wrap "class" as a key
name with quotes, otherwise it will error in IE. ({'class':"blah"},
instead of {class:"blah"})
hope this helps :)
- Aaron
On Feb 13, 8:24 am, [EMAIL PROTECTED] wrote:
> Hello,
>
> I have a question concerning the createDOM function. I tried to create a
> table row and insert it into an existing table. I'm wondering about two
> things:
> a) The first new element (here: TR) has to be created twice, otherwise it
> won't get rendered in HTML.
> b) Each new element contains an extend-attribute; I would like to know what
> they are for (and if they are not needed, how I could delete them).
>
> Below is the Javascript and the resulting HTML code (currently I'm using
> Firefox 2.0 on Linux):
>
> var newTR = TR(null,
> TR({id:'xy', class:'trClass'},
> TD({style:'padding-left: 36pt'}, 'Hello...')));
>
> new Insertion.After('row1.4', newTR.innerHTML); //(uses
> Prototype-library)
>
> ---------HTML------------
> .
> .
> <tr id="xy" class="trClass" extend="function (object) {return
> Object.extend.apply(this, [this, object]);}"><td style="padding-left: 36pt;"
> extend="function (object) {return Object.extend.apply(this, [this,
> object]);}">Hello...</td></tr>.
> .
>
> Any help is greatly appreciated!
>
> Best regards,
> Felix
>
> "Jetzt Handykosten senken mit klarmobil - 14 Ct./Min.! Hier
> klicken"http://www.klarmobil.de/index.html?pid=73025
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---