On 4/21/06, Michele Cella <[EMAIL PROTECTED]> wrote:
>
>
> Bob Ippolito wrote:
> > On Apr 21, 2006, at 6:23 AM, Fariborz Grayli wrote:
> >
> > > I am just wondering if there is anything like this in MochiKit.
> > >
> > >
> > >
> > > function loadXML(data) {
> > >
> > > if (DOMParser) return (new DOMParser()).parseFromString
> > > (data, 'text/xml');
> > >
> > > if (ActiveXObject) return (new ActiveXObject
> > > ("microsoft.XMLDOM")).loadXML(data);
> > >
> > > return null;
> > >
> > > }
> > >
> > >
> > >
> > > I need to convert an arbitrary string to a Dom-Object.
> >
> > No, there is not currently anything like that in MochiKit.
> >
>
> Am I wrong or this recipe does something similar by using innerHTML?
>
> http://trac.mochikit.org/wiki/ParsingHtml
>
> By the way it would be cool to have something like that without relying
> on innerHTML (that doesn't work if you are serving xhtml right?).
>
> Ciao
> Michele
The question of XHTML vs. say 4.01 HTML has no bearing on the
innerHTML dilemma (so long as you're using valid XHTML in your
innerHTML). The reason innerHTML is "tainted" is that it was a
non-standard method introduced by microsoft, so far as I understand
it.
But the other horn of the dilemma is that innerHTML appears to be
faster than DOM node-appending methods:
http://www.quirksmode.org/index.html?/dom/innerhtml.html
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---