Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

CommonJS implementation of the DOM intended to be platform independent and as minimal/light as possible while completely adhering to the w3c DOM specifications.

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 example
Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 PLAN.md
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
Octocat-spinner-32 status.json
Octocat-spinner-32 wscript
README.md

jsdom

CommonJS implementation of the DOM intended to be platform independent and as minimal/light as possible while completely adhering to the w3c DOM specifications.

Currently Implemented and w3c Compliant:

  • DOM Level 1 (html/svg/xml)
  • Browser (BOM) Augmentation (getElementsByClassName, getElementById, etc..)

Note: Running the tests now requires mjsunit.runner

see: testlog for w3 test compliance

see: plan for roadmap and thoughts about this project

see: project site for additional information

Examples

jQuery

  var sys    = require("sys"),
      jsdom  = require(__dirname + "/../../lib/jsdom"),
      window = jsdom.jsdom().createWindow();
  
  // this also works:
  // jQueryTag.src = "http://code.jquery.com/jquery-1.4.2.js";
  jsdom.jQueryify(window, __dirname + "/jquery.js", function() {
    window.jQuery('body').append("<div class='testing'>Hello World, It works!</div>");
    sys.puts(window.jQuery(".testing").text());
  });
Something went wrong with that request. Please try again.