Skip to content
This repository
Newer
Older
100644 327 lines (224 sloc) 14.521 kb
86a167d7 »
2011-09-20 Edited README.md via GitHub
1 # jsdom
e1abc489 »
2010-01-19 added some metadata
2
82c16d90 » domenic
2014-05-30 Whoops, missed a spec reference update.
3 A JavaScript implementation of the WHATWG DOM and HTML standards.
3235f395 »
2010-02-26
4
13a80d67 »
2011-02-18 readme fixes, changed request dep to >=1.0.0 for pre-node 0.3.6 support
5 ## Install
edfe278e »
2010-02-21
6
688bea39 » domenic
2012-10-05 Readme cleanup.
7 ```bash
8 $ npm install jsdom
9 ```
70fb7ec0 »
2010-02-05 updated readme
10
e87cb1cf » domenic
2013-02-12 Contextify is not optional!! Closes #456.
11 If this gives you trouble with errors about installing Contextify, especially on Windows, see [below](#contextify).
12
83bfd223 »
2011-10-09 Update docs
13 ## Human contact
14
688bea39 » domenic
2012-10-05 Readme cleanup.
15 see: [mailing list](http://groups.google.com/group/jsdom)
83bfd223 »
2011-10-09 Update docs
16
b3e1213a » domenic
2014-06-18 Rewrite the introductions to jsdom.env/jsdom.jsdom.
17 ## Easymode: `jsdom.env`
4faadca9 »
2011-02-16 updated readme
18
b3e1213a » domenic
2014-06-18 Rewrite the introductions to jsdom.env/jsdom.jsdom.
19 `jsdom.env` is an API that allows you to throw a bunch of stuff at it, and it will generally do the right thing.
4faadca9 »
2011-02-16 updated readme
20
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
21 You can use it with a URL
76c74157 » karunasagark
2011-05-15 fixed the example to config object
22
688bea39 » domenic
2012-10-05 Readme cleanup.
23 ```js
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
24 // Count all of the links from the Node.js build page
688bea39 » domenic
2012-10-05 Readme cleanup.
25 var jsdom = require("jsdom");
26
27 jsdom.env(
28 "http://nodejs.org/dist/",
29 ["http://code.jquery.com/jquery.js"],
30 function (errors, window) {
31 console.log("there have been", window.$("a").length, "nodejs releases!");
32 }
33 );
34 ```
35
36 or with raw HTML
37
38 ```js
39 // Run some jQuery on a html fragment
40 var jsdom = require("jsdom");
41
42 jsdom.env(
43 '<p><a class="the-link" href="https://github.com/tmpvar/jsdom">jsdom\'s Homepage</a></p>',
44 ["http://code.jquery.com/jquery.js"],
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
45 function (errors, window) {
688bea39 » domenic
2012-10-05 Readme cleanup.
46 console.log("contents of a.the-link:", window.$("a.the-link").text());
47 }
48 );
49 ```
4faadca9 »
2011-02-16 updated readme
50
13a80d67 »
2011-02-18 readme fixes, changed request dep to >=1.0.0 for pre-node 0.3.6 support
51 or with a configuration object
52
688bea39 » domenic
2012-10-05 Readme cleanup.
53 ```js
b3e1213a » domenic
2014-06-18 Rewrite the introductions to jsdom.env/jsdom.jsdom.
54 // Print all of the news items on Hacker News
688bea39 » domenic
2012-10-05 Readme cleanup.
55 var jsdom = require("jsdom");
56
57 jsdom.env({
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
58 url: "http://news.ycombinator.com/",
688bea39 » domenic
2012-10-05 Readme cleanup.
59 scripts: ["http://code.jquery.com/jquery.js"],
60 done: function (errors, window) {
61 var $ = window.$;
62 console.log("HN Links");
63 $("td.title:not(:last) a").each(function() {
64 console.log(" -", $(this).text());
deaedc1c »
2011-07-21 updated README, bump version (0.2.1), and removed old files
65 });
688bea39 » domenic
2012-10-05 Readme cleanup.
66 }
67 });
68 ```
69
70 or with raw JavaScript source
71
72 ```js
b3e1213a » domenic
2014-06-18 Rewrite the introductions to jsdom.env/jsdom.jsdom.
73 // Print all of the news items on Hacker News
688bea39 » domenic
2012-10-05 Readme cleanup.
74 var jsdom = require("jsdom");
75 var fs = require("fs");
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
76 var jquery = fs.readFileSync("./jquery.js", "utf-8");
688bea39 » domenic
2012-10-05 Readme cleanup.
77
78 jsdom.env({
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
79 url: "http://news.ycombinator.com/",
688bea39 » domenic
2012-10-05 Readme cleanup.
80 src: [jquery],
81 done: function (errors, window) {
82 var $ = window.$;
83 console.log("HN Links");
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
84 $("td.title:not(:last) a").each(function () {
688bea39 » domenic
2012-10-05 Readme cleanup.
85 console.log(" -", $(this).text());
deaedc1c »
2011-07-21 updated README, bump version (0.2.1), and removed old files
86 });
688bea39 » domenic
2012-10-05 Readme cleanup.
87 }
88 });
89 ```
82b86b3b »
2011-02-18 added hackernews example in the readme
90
13a80d67 »
2011-02-18 readme fixes, changed request dep to >=1.0.0 for pre-node 0.3.6 support
91 ### How it works
2961b7c9 » domenic
2014-06-18 Document new initialization lifecycle options from #792.
92
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
93 The do-what-I-mean API is used like so:
688bea39 » domenic
2012-10-05 Readme cleanup.
94
95 ```js
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
96 jsdom.env(string, [scripts], [config], callback);
688bea39 » domenic
2012-10-05 Readme cleanup.
97 ```
98
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
99 - `string`: may be a URL, file name, or HTML fragment
100 - `scripts`: a string or array of strings, containing file names or URLs that will be inserted as `<script>` tags
101 - `config`: see below
102 - `callback`: takes two arguments
2961b7c9 » domenic
2014-06-18 Document new initialization lifecycle options from #792.
103 - `errors`: either `null`, if nothing goes wrong, or an array of errors
104 - `window`: a brand new `window`, if there were no loading errors
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
105
106 _Example:_
688bea39 » domenic
2012-10-05 Readme cleanup.
107
108 ```js
109 jsdom.env(html, function (errors, window) {
110 // free memory associated with the window
111 window.close();
112 });
113 ```
114
115 If you would like to specify a configuration object only:
116
117 ```js
118 jsdom.env(config);
119 ```
120
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
121 - `config.html`: a HTML fragment
122 - `config.file`: a file which jsdom will load HTML from; the resulting window's `location.href` will be a `file://` URL.
123 - `config.url`: sets the resulting window's `location.href`; if `config.html` and `config.file` are not provided, jsdom will load HTML from this URL.
688bea39 » domenic
2012-10-05 Readme cleanup.
124 - `config.scripts`: see `scripts` above.
125 - `config.src`: an array of JavaScript strings that will be evaluated against the resulting document. Similar to `scripts`, but it accepts JavaScript instead of paths/URLs.
26d2d2dd » domenic
2014-01-05 Update documentation on the options.
126 - `config.jar`: a custom cookie jar, if desired; see [mikeal/request](https://github.com/mikeal/request) documentation.
1337ee6d » domenic
2014-06-18 Hide `level` setting better.
127 - `config.level`: either `1`, `2`, `3`, or `'living'`, to restrict yourselves to features in certain DOM specifications. The default is `'living'`.
688bea39 » domenic
2012-10-05 Readme cleanup.
128 - `config.document`:
b3214697 » domenic
2014-03-08 Fix readme referrer typo. (See #745)
129 - `referrer`: the new document will have this referrer.
6839a630 » domenic
2013-07-21 Fix some typos and casing for cookies.
130 - `cookie`: manually set a cookie value, e.g. `'key=value; expires=Wed, Sep 21 2011 12:00:00 GMT; path=/'`.
131 - `cookieDomain`: a cookie domain for the manually set cookie; defaults to `127.0.0.1`.
1337ee6d » domenic
2014-06-18 Hide `level` setting better.
132 - `config.features`: see `Flexibility` section below. **Note**: the default feature set for jsdom.env does _not_ include fetching remote JavaScript and executing it. This is something that you will need to **carefully** enable yourself.
2961b7c9 » domenic
2014-06-18 Document new initialization lifecycle options from #792.
133 - `config.done`, `config.loaded`, `config.created`: see below.
134
135 Note that at least one of the callbacks (`done`, `loaded`, or `created`) is required, as is one of `html`, `file`, or `url`.
136
137 ### Initialization lifecycle
138
139 If you just want to load the document and execute it, the `done` callback shown above is the simplest. If anything goes wrong, either while loading the document and creating the window, or while executing any `<script>`s, the problem will show up in the `errors` array passed as the first argument.
140
141 However, if you want more control over or insight into the initialization lifecycle, you'll want to use the `created` and/or `loaded` callbacks:
142
143 #### `created(error, window)`
144
145 The `created` callback is called as soon as the window is created, or if that process fails. You may access all `window` properties here; however, `window.document` is not ready for use yet, as the HTML has not been parsed.
146
147 The primary use-case for `created` is to modify the window object (e.g. add new functions on built-in prototypes) before any scripts execute.
148
149 You can also set an event handler for `'load'` or other events on the window if you wish. But the `loaded` callback, below, can be more useful, since it includes script errors.
150
151 If the `error` argument is non-`null`, it will contain whatever loading error caused the window creation to fail; in that case `window` will not be passed.
152
153 #### `loaded(errors, window)`
154
155 The `loaded` callback is called along with the window's `'load'` event. This means it will only be called if creation succeeds without error. Note that by the time it has called, any external resources will have been downloaded, and any `<script>`s will have finished executing.
156
157 If `errors` is non-`null`, it will contain an array of all JavaScript errors that occured during script execution. `window` will still be passed, however.
158
159 #### `done(errors, window)`
160
161 Now that you know about `created` and `loaded`, you can see that `done` is essentially both of them smashed together:
162
163 - If window creation succeeds and no `<script>`s cause errors, then `errors` will be null, and `window` will be usable.
164 - If window creation succeeds but there are script errors, then `errors` will be an array containing those errors, but `window` will still be usable.
165 - If window creation fails, then `errors` will be an array containing the creation error, and `window` will not be passed.
166
167 #### Migrating from before v1.0.0
aeb0e9cb »
2011-01-18 updated readme
168
2961b7c9 » domenic
2014-06-18 Document new initialization lifecycle options from #792.
169 If you used jsdom before v1.0.0, it only had a `done` callback, and it was kind of buggy, sometimes behaving one way, and sometimes another. Due to some excellent work by [@Sebmaster](https://github.com/Sebmaster) in [#792](https://github.com/tmpvar/jsdom/pull/792), we fixed it up into the above lifecycle. For more information on the migration, see [the wiki](https://github.com/tmpvar/jsdom/wiki/PR-792).
006df1af » domenic
2013-06-03 Rewrite how `jsdom.env` handles config vs. strings.
170
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
171 ### On running scripts and being safe
172
173 By default, `jsdom.env` will not process and run external JavaScript, since our sandbox is not foolproof. That is, code running inside the DOM's `<script>`s can, if it tries hard enough, get access to the Node environment, and thus to your machine. If you want to (carefully!) enable running JavaScript, you can use `jsdom.jsdom`, `jsdom.jQueryify`, or modify the defaults passed to `jsdom.env`.
174
b3e1213a » domenic
2014-06-18 Rewrite the introductions to jsdom.env/jsdom.jsdom.
175 ## For the hardcore: `jsdom.jsdom`
1d79a8cf »
2011-02-18 preparing for takeoff
176
b3e1213a » domenic
2014-06-18 Rewrite the introductions to jsdom.env/jsdom.jsdom.
177 The `jsdom.jsdom` method does less things automatically; it takes in only HTML source, and does not let you to separately supply script that it will inject and execute. It just gives you back a `document` object, with usable `document.parentWindow`, and starts asynchronously executing any `<script>`s included in the HTML source. You can listen for the `'load'` event to wait until scripts are done loading and executing, just like you would in a normal HTML page.
178
179 Usage of the API generally looks like this:
1d79a8cf »
2011-02-18 preparing for takeoff
180
688bea39 » domenic
2012-10-05 Readme cleanup.
181 ```js
182 var jsdom = require("jsdom").jsdom;
1337ee6d » domenic
2014-06-18 Hide `level` setting better.
183 var doc = jsdom(markup, options);
31d35ba8 » domenic
2013-07-21 Use .parentWindow instead of .createWindow() in the docs.
184 var window = doc.parentWindow;
688bea39 » domenic
2012-10-05 Readme cleanup.
185 ```
deaedc1c »
2011-07-21 updated README, bump version (0.2.1), and removed old files
186
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
187 - `markup` is a HTML document to be parsed. You can also pass `undefined` to get the basic document, equivalent to what a browser will give if you open up an empty `.html` file.
1d79a8cf »
2011-02-18 preparing for takeoff
188
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
189 - `options`: see the explanation of the `config` object above.
1d79a8cf »
2011-02-18 preparing for takeoff
190
13a80d67 »
2011-02-18 readme fixes, changed request dep to >=1.0.0 for pre-node 0.3.6 support
191 ### Flexibility
1d79a8cf »
2011-02-18 preparing for takeoff
192
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
193 One of the goals of jsdom is to be as minimal and light as possible. This section details how someone can change the behavior of `Document`s before they are created. These features are baked into the `DOMImplementation` that every `Document` has, and may be tweaked in two ways:
aeb0e9cb »
2011-01-18 updated readme
194
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
195 1. When you create a new `Document`, by overriding the configuration:
aeb0e9cb »
2011-01-18 updated readme
196
688bea39 » domenic
2012-10-05 Readme cleanup.
197 ```js
198 var jsdom = require("jsdom").jsdom;
1337ee6d » domenic
2014-06-18 Hide `level` setting better.
199 var doc = jsdom("<html><body></body></html>", {
b2a59ae6 »
2012-11-19 Fix: indentation in features examples
200 features: {
201 FetchExternalResources : ["img"]
202 }
688bea39 » domenic
2012-10-05 Readme cleanup.
203 });
204 ```
aeb0e9cb »
2011-01-18 updated readme
205
688bea39 » domenic
2012-10-05 Readme cleanup.
206 Do note, that this will only affect the document that is currently being created. All other documents will use the defaults specified below (see: Default Features).
aeb0e9cb »
2011-01-18 updated readme
207
688bea39 » domenic
2012-10-05 Readme cleanup.
208 2. Before creating any documents, you can modify the defaults for all future documents:
aeb0e9cb »
2011-01-18 updated readme
209
688bea39 » domenic
2012-10-05 Readme cleanup.
210 ```js
211 require("jsdom").defaultDocumentFeatures = {
b2a59ae6 »
2012-11-19 Fix: indentation in features examples
212 FetchExternalResources: ["script"],
69c30a1c » domenic
2012-12-10 Stop documenting that you can turn off MutationEvents.
213 ProcessExternalResources: false
688bea39 » domenic
2012-10-05 Readme cleanup.
214 };
215 ```
aeb0e9cb »
2011-01-18 updated readme
216
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
217 #### External Resources
aeb0e9cb »
2011-01-18 updated readme
218
219 Default features are extremely important for jsdom as they lower the configuration requirement and present developers a set of consistent default behaviors. The following sections detail the available features, their defaults, and the values that jsdom uses.
220
13a80d67 »
2011-02-18 readme fixes, changed request dep to >=1.0.0 for pre-node 0.3.6 support
221 `FetchExternalResources`
aeb0e9cb »
2011-01-18 updated readme
222
688bea39 » domenic
2012-10-05 Readme cleanup.
223 - _Default_: `["script"]`
0a6aa16d » domenic
2012-10-11 Add iframes to the list of external resources.
224 - _Allowed_: `["script", "img", "css", "frame", "iframe", "link"]` or `false`
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
225 - _Default for `jsdom.env`_: `false`
688bea39 » domenic
2012-10-05 Readme cleanup.
226
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
227 Enables/disables fetching files over the file system/HTTP
aeb0e9cb »
2011-01-18 updated readme
228
13a80d67 »
2011-02-18 readme fixes, changed request dep to >=1.0.0 for pre-node 0.3.6 support
229 `ProcessExternalResources`
deaedc1c »
2011-07-21 updated README, bump version (0.2.1), and removed old files
230
688bea39 » domenic
2012-10-05 Readme cleanup.
231 - _Default_: `["script"]`
232 - _Allowed_: `["script"]` or `false`
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
233 - _Default for `jsdom.env`_: `false`
688bea39 » domenic
2012-10-05 Readme cleanup.
234
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
235 Enables/disables JavaScript execution
aeb0e9cb »
2011-01-18 updated readme
236
23b3b6c9 » fgalassi
2012-10-19 Add SkipExternalResources feature
237 `SkipExternalResources`
238
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
239 - _Default_: `false` (allow all)
23b3b6c9 » fgalassi
2012-10-19 Add SkipExternalResources feature
240 - _Allowed_: `/url to be skipped/` or `false`
241 - _Example_: `/http:\/\/example.org/js/bad\.js/`
242
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
243 Filters resource downloading and processing to disallow those maching the given regular expression
23b3b6c9 » fgalassi
2012-10-19 Add SkipExternalResources feature
244
9e547c4a » domenic
2013-02-12 Fix heading levels and trailing whitespace.
245 ### Canvas
c859c8a1 » domenic
2012-10-11 Document the <canvas> feature. Closes #479.
246
247 jsdom includes support for using the [canvas](https://npmjs.org/package/canvas) package to extend any `<canvas>` elements with the canvas API. To make this work, you need to include canvas as a dependency in your project, as a peer of jsdom. If jsdom can find the canvas package, it will use it, but if it's not present, then `<canvas>` elements will behave like `<div>`s.
248
9e547c4a » domenic
2013-02-12 Fix heading levels and trailing whitespace.
249 ## More Examples
2351e18e »
2010-08-19
250
1337ee6d » domenic
2014-06-18 Hide `level` setting better.
251 ### Creating a browser-like Window
688bea39 » domenic
2012-10-05 Readme cleanup.
252
253 ```js
254 var jsdom = require("jsdom").jsdom;
13be0e7f » domenic
2014-07-09 A pass through the readme for clarity
255 var document = jsdom("hello world");
31d35ba8 » domenic
2013-07-21 Use .parentWindow instead of .createWindow() in the docs.
256 var window = document.parentWindow;
0df8ca52 »
2010-09-18 updated readme with some important updates
257
688bea39 » domenic
2012-10-05 Readme cleanup.
258 console.log(window.document.innerHTML);
259 // output: "<html><head></head><body>hello world</body></html>"
0df8ca52 »
2010-09-18 updated readme with some important updates
260
688bea39 » domenic
2012-10-05 Readme cleanup.
261 console.log(window.innerWidth);
262 // output: 1024
0df8ca52 »
2010-09-18 updated readme with some important updates
263
688bea39 » domenic
2012-10-05 Readme cleanup.
264 console.log(typeof window.document.getElementsByClassName);
265 // outputs: function
266 ```
a60bb1c9 »
2010-09-18
267
fe430342 » domenic
2013-06-03 Fix heading level.
268 ### jQueryify
30575d55 »
2010-09-18 fixed examples, and a bug in createWindow()
269
688bea39 » domenic
2012-10-05 Readme cleanup.
270 ```js
271 var jsdom = require("jsdom");
31d35ba8 » domenic
2013-07-21 Use .parentWindow instead of .createWindow() in the docs.
272 var window = jsdom.jsdom().parentWindow;
30575d55 »
2010-09-18 fixed examples, and a bug in createWindow()
273
2af9b557 » domenic
2014-07-09 Don't use a default jQuery URL in jQueryify.
274 jsdom.jQueryify(window, "http://code.jquery.com/jquery-2.1.1.js", function () {
688bea39 » domenic
2012-10-05 Readme cleanup.
275 window.$("body").append('<div class="testing">Hello World, It works</div>');
276
277 console.log(window.$(".testing").text());
278 });
279 ```
4faadca9 »
2011-02-16 updated readme
280
9e547c4a » domenic
2013-02-12 Fix heading levels and trailing whitespace.
281 ### Passing objects to scripts inside the page
3a4466f5 » domenic
2012-10-11 Document how to pass objects from Node to the page.
282
283 ```js
284 var jsdom = require("jsdom").jsdom;
31d35ba8 » domenic
2013-07-21 Use .parentWindow instead of .createWindow() in the docs.
285 var window = jsdom().parentWindow;
3a4466f5 » domenic
2012-10-11 Document how to pass objects from Node to the page.
286
287 window.__myObject = { foo: "bar" };
288
289 var scriptEl = window.document.createElement("script");
290 scriptEl.src = "anotherScript.js";
291 window.document.body.appendChild(scriptEl);
292
293 // anotherScript.js will have the ability to read `window.__myObject`, even
294 // though it originated in Node!
295 ```
296
4e1b57f1 » domenic
2014-07-09 Comment on spec supported.
297 ## What Standards Does jsdom Support, Exactly?
298
299 Our mission is to get something very close to a headless browser, with emphasis more on the DOM/HTML side of things than the CSS side. As such, our primary goals are supporting [The DOM Standard](http://dom.spec.whatwg.org/) and [The HTML Standard](http://www.whatwg.org/specs/web-apps/current-work/multipage/). We only support some subset of these so far; in particular we have the subset covered by the outdated DOM 2 spec family down pretty well. We're slowly including more and more from the modern DOM and HTML specs, including some `Node` APIs, `querySelector(All)`, attribute semantics, the history and URL APIs, and the HTML parsing algorithm.
300
301 We also support some subset of the [CSSOM](http://dev.w3.org/csswg/cssom/), largely via [@chad3814](https://github.com/chad3814)'s excellent [cssstyle](https://www.npmjs.org/package/cssstyle) package. In general we want to make webpages run headlessly as best we can, and if there are other specs we should be incorporating, let us know.
302
e87cb1cf » domenic
2013-02-12 Contextify is not optional!! Closes #456.
303 ## Contextify
304
f633ba46 » domenic
2014-07-09 Stop hard-wrapping the Markdown
305 [Contextify](https://npmjs.org/package/contextify) is a dependency of jsdom, used for running `<script>` tags within the page. In other words, it allows jsdom, which is run in Node.js, to run strings of JavaScript in an isolated environment that pretends to be a browser environment instead of a server. You can see how this is an important feature.
e87cb1cf » domenic
2013-02-12 Contextify is not optional!! Closes #456.
306
f633ba46 » domenic
2014-07-09 Stop hard-wrapping the Markdown
307 Unfortunately, doing this kind of magic requires C++. And in Node.js, using C++ from JavaScript means using "native modules." Native modules are compiled at installation time so that they work precisely for your machine; that is, you don't download a contextify binary from npm, but instead build one locally after downloading the source from npm.
e87cb1cf » domenic
2013-02-12 Contextify is not optional!! Closes #456.
308
f633ba46 » domenic
2014-07-09 Stop hard-wrapping the Markdown
309 Getting C++ compiled within npm's installation system can be tricky, especially for Windows users. Thus, one of the most common problems with jsdom is trying to use it without the proper compilation tools installed. Here's what you need to compile Contextify, and thus to install jsdom:
9b931c5a » domenic
2013-12-14 Fix #701: explain that Mac users need XCode set up.
310
311 ### Windows
e87cb1cf » domenic
2013-02-12 Contextify is not optional!! Closes #456.
312
f633ba46 » domenic
2014-07-09 Stop hard-wrapping the Markdown
313 - The latest version of [Node.js for Windows](http://nodejs.org/download/)
314 - A copy of [Visual Studio Express 2013 for Windows Desktop](http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop)
315 - A copy of [Python 2.7](http://www.python.org/download/), installed in the default location of `C:\Python27`
e87cb1cf » domenic
2013-02-12 Contextify is not optional!! Closes #456.
316
f633ba46 » domenic
2014-07-09 Stop hard-wrapping the Markdown
317 There are some slight modifications to this that can work; for example other Visual Studio versions often work too. But it's tricky, so start with the basics!
9b931c5a » domenic
2013-12-14 Fix #701: explain that Mac users need XCode set up.
318
319 ### Mac
320
f633ba46 » domenic
2014-07-09 Stop hard-wrapping the Markdown
321 - XCode needs to be installed
322 - "Command line tools for XCode" need to be installed
323 - Launch XCode once to accept the license, etc. and ensure it's properly installed
9b931c5a » domenic
2013-12-14 Fix #701: explain that Mac users need XCode set up.
324
325 ### Linux
326
f633ba46 » domenic
2014-07-09 Stop hard-wrapping the Markdown
327 You'll need various build tools installed, like `make`, Python 2.7, and a compiler toolchain. How to install these will be specific to your distro, if you don't already have them.
Something went wrong with that request. Please try again.