W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2012

Re: [whatwg] Proposal for window.DocumentType.prototype.toString

From: Tim Streater <tim@clothears.org.uk>
Date: 30 Oct 2012 16:15 +0000
To: <whatwg@whatwg.org>
Message-Id: <20121030161554.39E936F4238@homiemail-mx21.g.dreamhost.com>
On 30 Oct 2012 at 10:20, Stewart Brodie <stewart.brodie@antplc.com> wrote: 

> Johan Sundström <oyasumi@gmail.com> wrote:

>> Serializing a complete HTML document DOM to a string is surprisingly
>> hard in javascript.
>
> Does XMLSerializer().serializeToString(document) not meet your requirement?

I was wondering that too. I use it to get the content of an iframe into a string, so I can send that off to a database. Seems to work without problems (Safari Mac 6.0.1). But I too had to ask how to do that; it wasn't particularly obvious that that was what I should have been using (to me at any rate).

--
Cheers  --  Tim
Received on Tuesday, 30 October 2012 16:16:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT