make it possible to get the full html from the window.document object?
See original GitHub issueThat is the last missing functionality I need to render full pages server side with jquery.
I can get this far (snippet):
var templateHtml = templateHtml, // read from file
doc = $(templateHtml);
var html = doc[1].outerHTML;
But that only renders the ‘html’ node from the doc, leaving out all the other nodes. I especially need to have the script nodes rendered to html. But if possible, the entire structure.
I hope that this functionality is already in there. And if it isn’t, I hope you have an idea as to get it in there.
Thanks for all the good work!
chek,
Maurice
Issue Analytics
- State:
- Created 12 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
How to get the entire document HTML as a string?
You can retrieve the doctype object with document.doctype; This returns an object, not a string, so if you need to extract the details...
Read more >How to get the entire HTML document as a string in JavaScript
Example 2: This example gets the whole document by first selecting the elements with tagname 'HTML' and selecting the first element by indexing ......
Read more >Window.document - Web APIs - MDN Web Docs - Mozilla
window.document returns a reference to the document contained in the window. Value. A document object. Examples.
Read more >HTML DOM Document Object - W3Schools
When an HTML document is loaded into a web browser, it becomes a document object. The document object is the root node of...
Read more >window.document object for browser. | by krishankant singhal
In this article, we will look at the properties of the window.document . if you do inspect and go to console and type...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Heads up to people arriving here via search engines, the API has changed to
dom.serialize()
as of writing: https://github.com/jsdom/jsdom#serializing-the-document-with-serializeIn master you can do
jsdom.serializeDocument(document)
.