About the conditional comments: These are parsed before the DOM is
created, and therefore not manipulable in the DOM. In non-IE browsers
you are able to get the comment node from the DOM, but in IE the
conditional comment does not exist in the DOM, nor is the HTML within
the conditional comment if the if-condition is false.

On 4 nov, 16:28, Eoghan <[EMAIL PROTECTED]> wrote:
> 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