code: function GetWindow() {
    var virtualConsole = new jsdom.VirtualConsole();
    virtualConsole.sendTo(console);
    window = new JSDOM('',{
      virtualConsole: virtualConsole,
      userAgent: "Node.js",
      runScripts: "dangerously",
      resources: "usable"
    }).window;
    document = window.document;
    html = document.firstChild;
    window.addEventListener("error",function (event) {AddError("Error: "+event.error.stack)});
    content = document.body.appendChild(document.createElement("div"));
    content.id = "MathJax_Content";
    content.innerHTML = '<script type="math/tex">x</script>' +
                        '<script type="math/asciimath">x</script>' +
                        '<script type="math/mml"><math><mi>x</mi></math></script>';
  }
docs: Create the DOM window and set up the console wtihin it Add an error handler to trap unexpected errors (requires modifying jsdom) Add a <div> where we can put the math to be typeset and typeset math in the three formats we use (to force the jax to be loaded completely)