Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I parse a html string into a document ?

42 views
Skip to first unread message

Chen Zhiyuan

unread,
Nov 13, 2006, 7:43:08 AM11/13/06
to
It seems that the DOMParser does not support parse a html string into
HTMLDocument? Is there a way to create the Document with a given
string?

Thank you !

mark bokil

unread,
Nov 13, 2006, 8:49:05 AM11/13/06
to dev-ext...@lists.mozilla.org
> _______________________________________________
> dev-extensions mailing list
> dev-ext...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions
>
>
>

var mytext = "<html><body><p>Hello</p></body></html>"
document.write(mytext);

Nickolay Ponomarev

unread,
Nov 13, 2006, 9:24:42 AM11/13/06
to Chen Zhiyuan, dev-ext...@lists.mozilla.org

Chen Zhiyuan

unread,
Nov 13, 2006, 11:03:28 AM11/13/06
to
I will try. thanks. But I am not sure if this is the most efficient way
to do it on Firefox.

On 11月13日, 下午4时24分, "Nickolay Ponomarev"
<asquee...@gmail.com> wrote:


> On 13 Nov 2006 04:43:08 -0800, Chen Zhiyuan <gsm.chenzhiy...@gmail.com> wrote:
>
> > It seems that the DOMParser does not support parse a html string into
> > HTMLDocument? Is there a way to create the Document with a given

> > string?http://groups-beta.google.com/group/netscape.public.mozilla.dom/brows...http://groups-beta.google.com/group/netscape.public.mozilla.dom/brows...


>
> You can use the hidden iframe trick to parse the HTML.
>
> Nickolay
>
>
>
> > Thank you !
>
> > _______________________________________________
> > dev-extensions mailing list

> > dev-extensi...@lists.mozilla.org
> >https://lists.mozilla.org/listinfo/dev-extensions

Myk Melez

unread,
Nov 13, 2006, 4:18:36 PM11/13/06
to

The microsummary service does this with a hidden iframe. Based on
discussions with the layout guys, this seems to be the best way of doing
it currently.

http://lxr.mozilla.org/mozilla/source/browser/components/microsummaries/src/nsMicrosummaryService.js.in#1862

-myk

Mike Shaver

unread,
Nov 13, 2006, 4:38:13 PM11/13/06
to Nickolay Ponomarev, dev-ext...@lists.mozilla.org, Chen Zhiyuan
0 new messages