jquery / jquery/api.jquery.com
Document window requirement for CommonJS environment
Open
Nobody has claimed this yet.
help wanted
- Dominant language
- HTML
- Stars
- 325
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
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 );
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the API documentation entry covering jQuery initialization and compare it with the linked ticket 13768. Document that a window object is required and include the shown CommonJS/jsdom usage example; done when readers know how to initialize jQuery in an environment without a default window.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100