Skip to content

Instantly share code, notes, and snippets.

@jos3000
Created June 13, 2010 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jos3000/436742 to your computer and use it in GitHub Desktop.
Save jos3000/436742 to your computer and use it in GitHub Desktop.
var sys = require("sys"),
dom = require("jsdom/lib/level1/core").dom.level1.core,
fs = require("fs");
var sax = require("jsdom/example/sizzle/sax");
var window = require("jsdom/lib/browser").windowAugmentation(dom, {parser: sax.parser()});
var document = window.document;
var location = window.location;
var navigator = window.navigator = { userAgent: "node-js" };
global.window = window;
var div = document.createElement('div');
document.body.appendChild(div);
div.innerHTML = "<span><img src='test' />foo<br /> bar<br /> </span><p><script>alert('test');\n\nconsole.log();</script>ting</p>";
sys.puts(document.outerHTML);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment