changing innerhtml/text of nodes/elements

George Vlahoulis gotj at optusnet.com.au
Sat Dec 28 08:48:58 GMT 2002


Hi,

when I do the following...

DOM::HTMLTableRowElement newrow = doc.createElement("TR");
DOM::HTMLTableElement table = doc.getElementsByTagName( "TBODY").item(0);
table.appendChild(newrow);
newrow.setInnerText(str);

DOM raises exception #7 ie NO_MODIFICATION_ALLOWED_ERR on call to
setInnerText. The same happens when I use setInnerHTML. The documents say:

Throws: DOMException, NO_MODIFICATION_ALLOWED_ERR:, Raised, if, there, is,
the, element, does, not, allow, children.

but I can quite happily, like above, create a HTMLTableCellElement and append
it. Variable str, above, contains all the text and html code like (colour
codes, alignments etc) for that row. What am I missing?

Also, when/if I get all this working, do I need to do anything to get the
KHTMLPart to update the view? I've looked but didnt see anything obvious.

Thanks.

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<




More information about the kfm-devel mailing list