JSDOM in nodeJS: How do I get back the manipulated html?
From the jsdom readme:
var JSDOM = require("jsdom").JSDOM;
var jsdom = new JSDOM("<!DOCTYPE html>hello");
jsdom.serialize() === "<!DOCTYPE html><html><head></head><body>hello</body></html>";
doc.documentElement.outerHTML === "<html><head></head><body>hello</body></html>";
Adapting your above example would then just be content = jsdom.serialize()
.
sometimes jQuery isn't the answer
content = window.document.documentElement.outerHTML;