Skip to content

Document window requirement for CommonJS environment #296

Open
@timmywil

Description

@timmywil

See http://bugs.jquery.com/ticket/13768.

jQuery needs a window object in order to be initialized correctly, but some environments do not have an available window object by default. For example, when requiring jQuery in a Node environment using jsdom:

// Define window
var window = jsdom.jsdom().createWindow();
// Require jQuery and pass in the created window
var $ = require("jquery")( window );

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions