I've come up with the following to insert MSIE conditional comments:

    function IE65(/*, nodes... */) {
        var inner = map(toHTML, arguments).join("");
        var node = DIV();
        node.innerHTML = "<!--[if lte IE 6.5]>" + inner + "<![endif]--
>";
        return node;
    }

I've tried document.createComment() and document.createTextNode() and
node.outerHTML but couldn't get any of them to produce results, so
settled for this method which produces a redundant wrapping DIV.

IE doesn't seem to respect style on inserted DOM nodes, so the
following doesn't come up red, (whereas putting the exact same markup
directly into the HTML document does):

        insertSiblingNodesAfter('myID', IE65(DIV({style: {color: 'red'}},
'test')));

Also, event handling doesn't work, but I'm pretty sure that's because
of my use of 'toHTML'

        var mydiv = DIV({}, 'test');
        connect(mydiv, "onclick", function(e){ alert('clicked'); });
        insertSiblingNodesAfter('myID', IE65(mydiv));

I don't expect this to be useful enough to be included in MochiKit,
but hopefully someone will find a use for it.

Eoghan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to