On Dec 4, 2005, at 7:59 AM, Erik van Blokland wrote:


Hullo,


One week of working with MochiKit - obsolutely awesome!

So far almost all of the problems I can solve with some tinkering, the MochiKit log window and the docs. Still, one problem when I want to create a new element for which there is no shortcut in MochiDOM.

I hope to be able to generate a new <canvas> element rather than modify something from the html. Here's my code:

        div = getElement('canvasContainer');
        attrs = {       
                                id:'myCanvas',
                                width:this.size.width,
                                height:this.size.height
                        };
        canvas = createDOM("canvas", attrs);
        swapDOM(div, canvas);

The HTML generated (picked from the Show DOM Tree menu in Safari):
        <CANVAS id="myCanvas" width="200" height="200">

..which looks right enough, the element appears in both browsers which support it. But I want the tag to be closed as well:
        <CANVAS id="myCanvas" width="200" height="200"></CANVAS >
I assume it's another parameter in createDOM(), but I've tried a number of things and none of them seem to have the right result.

The result is correct, Safari's Show DOM display is wrong.

-bob

Reply via email to