question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

make it possible to get the full html from the window.document object?

See original GitHub issue

That 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:closed
  • Created 12 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

9reactions
josephroccacommented, Jul 6, 2019

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-serialize

2reactions
domeniccommented, Aug 1, 2014

In master you can do jsdom.serializeDocument(document).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found