Sha256: f6922569c95e28aff2d7546ad099a01d8ae6d51e1b1b5de45e28b875876ca54e

Contents?: true

Size: 1.94 KB

Versions: 32

Compression:

Stored size: 1.94 KB

Contents

# jQuery

> jQuery is a fast, small, and feature-rich JavaScript library.

For information on how to get started and how to use jQuery, please see [jQuery's documentation](http://api.jquery.com/).
For source files and issues, please visit the [jQuery repo](https://github.com/jquery/jquery).

If upgrading, please see the [blog post for 3.5.0](https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/). This includes notable differences from the previous version and a more readable changelog.

## Including jQuery

Below are some of the most common ways to include jQuery.

### Browser

#### Script tag

```html
<script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
```

#### Babel

[Babel](http://babeljs.io/) is a next generation JavaScript compiler. One of the features is the ability to use ES6/ES2015 modules now, even though browsers do not yet support this feature natively.

```js
import $ from "jquery";
```

#### Browserify/Webpack

There are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documention. In the script, including jQuery will usually look like this...

```js
var $ = require( "jquery" );
```

#### AMD (Asynchronous Module Definition)

AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](http://requirejs.org/docs/whyamd.html).

```js
define( [ "jquery" ], function( $ ) {

} );
```

### Node

To include jQuery in [Node](nodejs.org), first install with npm.

```sh
npm install jquery
```

For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/tmpvar/jsdom). This can be useful for testing purposes.

```js
const { JSDOM } = require( "jsdom" );
const { window } = new JSDOM( "" );
const $ = require( "jquery" )( window );
```

Version data entries

32 entries across 26 versions & 2 rubygems

Version Path
trusty-cms-6.3.1 node_modules/jquery-ujs/node_modules/jquery/README.md
trusty-cms-5.0.7 node_modules/jquery/README.md
trusty-cms-5.0.6 node_modules/jquery/README.md
trusty-cms-5.0.5 node_modules/jquery/README.md
trusty-cms-5.0.4 node_modules/jquery/README.md
trusty-cms-5.0.3 node_modules/jquery/README.md
trusty-cms-5.0.2 node_modules/jquery/README.md
trusty-cms-5.0.1 node_modules/jquery/README.md
trusty-cms-4.3.5 node_modules/jquery/README.md
trusty-cms-5.0.0 node_modules/jquery/README.md
trusty-cms-4.3.4 spec/dummy/node_modules/jquery/README.md
trusty-cms-4.3.4 node_modules/jquery/README.md
trusty-cms-4.3.3 node_modules/jquery/README.md
trusty-cms-4.3.3 spec/dummy/node_modules/jquery/README.md
trusty-cms-4.3.2 node_modules/jquery/README.md
trusty-cms-4.3.2 spec/dummy/node_modules/jquery/README.md
trusty-cms-4.3.1 spec/dummy/node_modules/jquery/README.md
trusty-cms-4.3.1 node_modules/jquery/README.md
trusty-cms-4.3 spec/dummy/node_modules/jquery/README.md
trusty-cms-4.3 node_modules/jquery/README.md