Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (18 sloc) 839 Bytes


When programming with Shipyard, if you ever wish to access a usual global that is available in a browser, such as window, document, or XMLHttpRequest, you must access it via the dom module.

This is important, as it prevents other modules from relying on environment globals that could not exist in other environments, such as the node test runner, shipyard test. The dom relies on jsdom to be able to provide the APIs you're looking for in the node environment, that would otherwise be undefined if you blindly tried to just access document globally.

An example:

var dom = require('shipyard/dom');

var el = new dom.Element('div');

However, if you think you need the dom to insert Elements, consider using a View instead.

Something went wrong with that request. Please try again.