[Twisted-web] LivePage cannot append rows to tables?

Mike Pelletier mike at mkp.ca
Mon Nov 21 18:44:55 MST 2005


On Mon November 21 2005 18:12, Jean-Paul Calderone wrote:
> This fails because nevow_appendNode sets the HTML string as the innerHTML
> property of a DIV node. The browser validates the resulting DOM, notices 
> it is illegal (you cannot put a TR or a TD inside a DIV) and then either
> silently "fixes" it or reports an error.

That is what I am seeing, yep.

> This might be fixable by appending the given HTML string to the target
> node's innerHTML property.  I have tested it with Firefox and it seems to
> work in many cases there, but I have not tested it anywhere else.

Thanks a lot for the hints.  I think you are suggesting something like:

function nevow_appendNode(node, what) {
    var oldnode = document.getElementById(node);
    oldnode.innerHTML += what;
}

This works just dandy on Firefox, and not at all on IE.  I get, "Error: 
unknown runtime error."  But oh well, it's a start.  Probably I'll look into 
hacking nevow_glue.js to use MochiKit.DOM.  Or...

> I'm not terribly interested in trying to fix this (nor all the JS and HTML
> quoting issues) in LivePage.  Currently I'm focusing development effort on
> Athena which side-steps this whole class of problems.  However, if someone
> contributes a patch along with something to instill confidence that the
> change does not introduce a regression, it might get applied.

...should I be looking into this?  I wasn't aware of nevow.athena, but I see 
I've got it installed.  I don't have any legacy code to worry about, should I 
just skip nevow.livepage completely?  Would you trust 0.6.0 not to put its 
elbows on the table or vomit on the Japanese?  I don't really want to hack up 
javascript if I can avoid it.

Mike.



More information about the Twisted-web mailing list