diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..8b808995d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.js, *.xsl] +indent_style = tab diff --git a/.github/configs/hydra-config.json b/.github/configs/hydra-config.json new file mode 100644 index 000000000..2173722b4 --- /dev/null +++ b/.github/configs/hydra-config.json @@ -0,0 +1,10 @@ +{ + "//": [ + "2023-05: twitter.com serves broken redirect-loop", + "2025-04: The oembed endpoint responds HTTP 429 Too Many Requests too often; perhaps because almost every page links to one" + ], + "exclude_scheme_prefixes": [ + "https://twitter.com/", + "https://api.jquery.com/wp-json/oembed/1.0/embed" + ] +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..aa2f74565 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: monthly + + # Group all dependabot version update PRs into one + groups: + github-actions: + applies-to: version-updates + patterns: + - "*" diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 000000000..30412870c --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,32 @@ +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + pull_request: + push: + branches-ignore: "dependabot/**" + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x] + + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Update apt-get cache + run: sudo apt-get update + - name: Install xmllint + run: sudo apt-get install -y libxml2-utils + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test diff --git a/.github/workflows/spider-check.yaml b/.github/workflows/spider-check.yaml new file mode 100644 index 000000000..95ea1ea24 --- /dev/null +++ b/.github/workflows/spider-check.yaml @@ -0,0 +1,32 @@ +name: spider-check +on: + # Once a week on Friday at 00:00 + schedule: + - cron: '0 0 * * 5' + # Or manually + workflow_dispatch: + # Or when developing this workflow + push: + paths: + - .github/workflows/spider-check.yaml + - .github/configs/hydra-config.json + pull_request: + paths: + - .github/workflows/spider-check.yaml + - .github/configs/hydra-config.json + +jobs: + spider-check: + if: ${{ github.repository_owner == 'jquery' }} # skip on forks + runs-on: ubuntu-latest + env: + # Site address to crawl + MY_SITE: https://api.jquery.com + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Run hydra-link-checker + run: | + curl -O https://raw.githubusercontent.com/jquery/hydra-link-checker/v2.0.0/hydra.py + python3 hydra.py "$MY_SITE" --config .github/configs/hydra-config.json diff --git a/.github/workflows/typesense.yaml b/.github/workflows/typesense.yaml new file mode 100644 index 000000000..de973410d --- /dev/null +++ b/.github/workflows/typesense.yaml @@ -0,0 +1,30 @@ +name: typesense +on: + # Once a day at 11:30 UTC + schedule: + - cron: '30 11 * * *' + # Or after a deployment + push: + branches: + - main + # Or manually + workflow_dispatch: + +jobs: + typesense: + name: Update Typesense + if: ${{ github.repository_owner == 'jquery' }} # skip on forks + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Docsearch Scraper + shell: bash + run: | + docker run \ + -e TYPESENSE_API_KEY=${{ secrets.TYPESENSE_ADMIN_KEY }} \ + -e TYPESENSE_HOST="${{ secrets.TYPESENSE_HOST }}" \ + -e TYPESENSE_PORT="443" \ + -e TYPESENSE_PROTOCOL="https" \ + -e CONFIG="$(cat docsearch.config.json | jq -r tostring)" \ + typesense/docsearch-scraper:0.9.1 diff --git a/.mailmap b/.mailmap index 7f902dbd8..5f931fbce 100644 --- a/.mailmap +++ b/.mailmap @@ -1,2 +1,6 @@ Matic Potočnik Michał Gołębiowski-Owczarek +Timmy Willison +Timmy Willison <4timmywil@gmail.com> +Timmy Willison +Timo Tijhof diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..3c032078a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +18 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 869297620..000000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.12" -before_script: - - npm install -g grunt-cli diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba9f6b8f2..9a004cd36 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ -Welcome! Thanks for your interest in contributing to api.jquery.com. You're **almost** in the right place. More information on how to contribute to this and all other jQuery Foundation projects is over at [contribute.jquery.org](http://contribute.jquery.org). You'll definitely want to take a look at the articles on contributing [documentation](http://contribute.jquery.org/documentation). +Welcome! Thanks for your interest in contributing to api.jquery.com. You're **almost** in the right place. More information on how to contribute to this and all other jQuery Foundation projects is over at [contribute.jquery.org](https://contribute.jquery.org). You'll definitely want to take a look at the articles on contributing [documentation](https://contribute.jquery.org/documentation). -You may also want to take a look at our [commit & pull request guide](http://contribute.jquery.org/commits-and-pull-requests/) and [style guides](http://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](http://contribute.jquery.org/cla). +You may also want to take a look at our [commit & pull request guide](https://contribute.jquery.org/commits-and-pull-requests/) and [style guides](https://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](https://contribute.jquery.org/cla). -You can find us on [IRC](http://irc.jquery.org), specifically in #jquery-dev and #jquery-content should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/). +You can find us on [IRC](https://irc.jquery.org), specifically in #jquery-dev and #jquery-content should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](https://contribute.jquery.org/open-source/). diff --git a/Gruntfile.js b/Gruntfile.js index 05990732c..10aa18ab0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -43,4 +43,6 @@ grunt.registerTask( "build", [ "build-xml-full" ]); +grunt.registerTask( "deploy", [ "wordpress-deploy", "deploy-redirects" ] ); + }; diff --git a/LICENSE.txt b/LICENSE.txt index 19a9bad25..203b68a7b 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright Packt Publishing (http://packtpub.com/), +Copyright Packt Publishing (https://www.packtpub.com/), jQuery Foundation (https://jquery.org/), and other contributors. This software consists of voluntary contributions made by many @@ -35,7 +35,7 @@ Copyright and related rights for sample code are waived via CC0. Sample code is defined as all source code displayed within the prose of the documentation and all examples and demos. -CC0: http://creativecommons.org/publicdomain/zero/1.0/ +CC0: https://creativecommons.org/publicdomain/zero/1.0/ ==== diff --git a/README.md b/README.md index 805e04422..f79208030 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ ## Building and Deploying -To build and deploy your changes for previewing in a [`jquery-wp-content`](https://github.com/jquery/jquery-wp-content) instance, follow the [workflow instructions](http://contribute.jquery.org/web-sites/#workflow) from our documentation on [contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/). +To build and deploy your changes for previewing in a [`jquery-wp-content`](https://github.com/jquery/jquery-wp-content) instance, follow the [workflow instructions](https://contribute.jquery.org/web-sites/#workflow) from our documentation on [contributing to jQuery Foundation web sites](https://contribute.jquery.org/web-sites/). ### Requirements * [libxml2](http://xmlsoft.org/) * [libxslt](http://xmlsoft.org/libxslt/) -The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from zlatkovic.com. +The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from zlatkovic.com. **Note**: If you're using Windows and you receive the error "Error" when executing the task `build-xml-entries:all`, try to add the DLL `libwinpthread-1.dll` in the root of the project. @@ -49,7 +49,7 @@ The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Wi ### Code Style -Code in the API documentation should follow the [jQuery Core Style Guide](http://contribute.jquery.org/style-guide/) with the following addition: +Code in the API documentation should follow the [jQuery Core Style Guide](https://contribute.jquery.org/style-guide/) with the following addition: * **Document ready syntax**: Use `$( document ).ready(function() {` instead of `$(function() {` as it's harder for new users to distinguish the difference between the latter and an IIFE. diff --git a/categories.xml b/categories.xml index 2ccd959e5..0f7d4df12 100644 --- a/categories.xml +++ b/categories.xml @@ -37,43 +37,86 @@ - - - - - - - - + + + + + + + + + + + + + + + - + @@ -170,15 +213,15 @@ var files = event.originalEvent.dataTransfer.files; - + + A few of these methods—such as .attr(), .html(), and .val()—also act as "getters," retrieving information from DOM elements for later use. + ]]> @@ -306,138 +349,284 @@ var files = event.originalEvent.dataTransfer.files; - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config-sample.json b/config-sample.json index b26cf9fce..2a56329c3 100644 --- a/config-sample.json +++ b/config-sample.json @@ -1,5 +1,5 @@ { - "url": "vagrant.api.jquery.com", - "username": "admin", - "password": "secret" + "url": "http://local.api.jquery.com", + "username": "dev", + "password": "dev" } diff --git a/docsearch.config.json b/docsearch.config.json new file mode 100644 index 000000000..f420af4af --- /dev/null +++ b/docsearch.config.json @@ -0,0 +1,52 @@ +{ + "index_name": "jquery_com", + "start_urls": [ + { "url": "https://api.jquery.com", "selectors_key": "api", "page_rank": 20 }, + { "url": "https://jquery.com", "page_rank": 10 } + ], + "stop_urls": [ + ".com/category/" + ], + "selectors": { + "default": { + "lvl0": { + "selector": "#menu-top .menu-item.current > a", + "global": true, + "default_value": "Documentation" + }, + "lvl1": "#content h1", + "lvl2": "#content h2", + "lvl3": "#content h3", + "lvl4": "#content h4", + "lvl5": "#content h5", + "text": "#content p, #content li, #content tr" + }, + "api": { + "lvl0": { + "selector": "#categories .cat-item.current-cat > a", + "global": true, + "default_value": "API" + }, + "lvl1": "#content h1", + "lvl2": "#content h2, #content h4.name", + "lvl3": "#content h3, #content h4:not(.name)", + "lvl4": "#content h5, #content strong:first-child", + "text": ".entry-content p, .entry-content li" + } + }, + "custom_settings": { + "token_separators": ["_", "-", "."] + }, + "selectors_exclude": [ + "header ~ article", + ".returns", + ".version-details", + ".section-title", + ".icon-link.toc-link", + "[class^=toclevel]", + "#toctitle", + ".desc strong:first-child" + ], + "min_indexed_level": 2, + "scrape_start_urls": false +} diff --git a/entries/add.xml b/entries/add.xml index 6f1d7870e..bb95b0f0b 100644 --- a/entries/add.xml +++ b/entries/add.xml @@ -20,7 +20,7 @@ - 1.3.2 + 1.1 An existing jQuery object to add to the set of matched elements. diff --git a/entries/addClass.xml b/entries/addClass.xml index 5dd99ec56..39d6a0bf5 100644 --- a/entries/addClass.xml +++ b/entries/addClass.xml @@ -7,6 +7,12 @@ One or more space-separated classes to be added to the class attribute of each matched element. + + 3.3 + + An array of classes to be added to the class attribute of each matched element. + + 1.4 @@ -16,6 +22,16 @@ + + 3.3 + + A function returning one or more space-separated class names or an array of class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + + + + + + Adds the specified class(es) to each element in the set of matched elements.

It's important to note that this method does not replace a class. It simply adds the class, appending it to any which may already be assigned to the elements.

@@ -64,7 +80,30 @@ $( "p" ).last().addClass( "selected" ); Add the classes "selected" and "highlight" to the matched elements. + + + + + Add the classes "selected" and "highlight" to the matched elements (3.3+ syntax). + + diff --git a/entries/ajaxError-shorthand.xml b/entries/ajaxError-shorthand.xml new file mode 100644 index 000000000..f36ac54a8 --- /dev/null +++ b/entries/ajaxError-shorthand.xml @@ -0,0 +1,19 @@ + + + .ajaxError() + Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + + 1.0 + + The function to be invoked. + + + +
+

This API is deprecated. Use .on( "ajaxError", handler ) instead.

+
+
+ + + +
diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml index 19abee09f..d18cf9775 100644 --- a/entries/ajaxError.xml +++ b/entries/ajaxError.xml @@ -1,8 +1,12 @@ - - .ajaxError() + + ajaxError event + Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. - 1.0 + 1.7 + + The string "ajaxError". + The function to be invoked. @@ -11,9 +15,11 @@ - Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. -

Whenever an Ajax request completes with an error, jQuery triggers the ajaxError event. Any and all handlers that have been registered with the .ajaxError() method are executed at this time. Note: This handler is not called for cross-domain script and cross-domain JSONP requests.

+
+

This page describes the ajaxError event. For the deprecated .ajaxError() method, see .ajaxError().

+
+

Whenever an Ajax request completes with an error, jQuery triggers the ajaxError event. Any and all registered ajaxError handlers are executed at this time. Note: This handler is not called for cross-domain script and cross-domain JSONP requests.

To observe this method in action, set up a basic Ajax load request.


 <button class="trigger">Trigger</button>
@@ -22,35 +28,37 @@
     

Attach the event handler to the document:


-$( document ).ajaxError(function() {
+$( document ).on( "ajaxError", function() {
   $( ".log" ).text( "Triggered ajaxError handler." );
-});
+} );
     

Now, make an Ajax request using any jQuery method:


 $( "button.trigger" ).on( "click", function() {
   $( "div.result" ).load( "ajax/missing.html" );
-});
+} );
     

When the user clicks the button and the Ajax request fails, because the requested file is missing, the log message is displayed.

All ajaxError handlers are invoked, regardless of what Ajax request was completed. To differentiate between the requests, use the parameters passed to the handler. Each time an ajaxError handler is executed, it is passed the event object, the jqXHR object (prior to jQuery 1.5, the XHR object), and the settings object that was used in the creation of the request. When an HTTP error occurs, the fourth argument (thrownError) receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." For example, to restrict the error callback to only handling events dealing with a particular URL:


-$( document ).ajaxError(function( event, jqxhr, settings, thrownError ) {
+$( document ).on( "ajaxError", function( event, jqxhr, settings, thrownError ) {
   if ( settings.url == "ajax/missing.html" ) {
     $( "div.log" ).text( "Triggered ajaxError handler." );
   }
-});
+} ); +
- - + + Show a message when an Ajax request fails. +
diff --git a/entries/ajaxSend-shorthand.xml b/entries/ajaxSend-shorthand.xml new file mode 100644 index 000000000..a9ae031e7 --- /dev/null +++ b/entries/ajaxSend-shorthand.xml @@ -0,0 +1,19 @@ + + + .ajaxSend() + Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + + 1.0 + + The function to be invoked. + + + +
+

This API is deprecated. Use .on( "ajaxSend", handler ) instead.

+
+
+ + + +
diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml index db814fee1..cbd1641cd 100644 --- a/entries/ajaxSend.xml +++ b/entries/ajaxSend.xml @@ -1,8 +1,12 @@ - - .ajaxSend() + + ajaxSend event + Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. - 1.0 + 1.7 + + The string "ajaxSend". + The function to be invoked. @@ -10,9 +14,11 @@ - Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. -

Whenever an Ajax request is about to be sent, jQuery triggers the ajaxSend event. Any and all handlers that have been registered with the .ajaxSend() method are executed at this time.

+
+

This page describes the ajaxSend event. For the deprecated .ajaxSend() method, see .ajaxSend().

+
+

Whenever an Ajax request is about to be sent, jQuery triggers the ajaxSend event. Any and all registerd ajaxSend handlers are executed at this time.

To observe this method in action, set up a basic Ajax load request:


 <div class="trigger">Trigger</div>
@@ -21,36 +27,37 @@
     

Attach the event handler to the document:


-$( document ).ajaxSend(function() {
+$( document ).on( "ajaxSend", function() {
   $( ".log" ).text( "Triggered ajaxSend handler." );
-});
+} );
     

Now, make an Ajax request using any jQuery method:


-$( ".trigger" ).click(function() {
+$( ".trigger" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
-});
+} );
     

When the user clicks the element with class trigger and the Ajax request is about to begin, the log message is displayed.

All ajaxSend handlers are invoked, regardless of what Ajax request is to be sent. If you must differentiate between the requests, use the parameters passed to the handler. Each time an ajaxSend handler is executed, it is passed the event object, the jqXHR object (in version 1.4, XMLHttpRequestobject), and the settings object that was used in the creation of the Ajax request. For example, you can restrict the callback to only handling events dealing with a particular URL:


-$( document ).ajaxSend(function( event, jqxhr, settings ) {
+$( document ).on( "ajaxSend", function( event, jqxhr, settings ) {
   if ( settings.url == "ajax/test.html" ) {
     $( ".log" ).text( "Triggered ajaxSend handler." );
   }
-});
+} );
     
- - + + Show a message before an Ajax request is sent. +
diff --git a/entries/ajaxStart-shorthand.xml b/entries/ajaxStart-shorthand.xml new file mode 100644 index 000000000..51b2fc9e3 --- /dev/null +++ b/entries/ajaxStart-shorthand.xml @@ -0,0 +1,19 @@ + + + .ajaxStart() + Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + + 1.0 + + The function to be invoked. + + + +
+

This API is deprecated. Use .on( "ajaxStart", handler ) instead.

+
+
+ + + +
diff --git a/entries/ajaxStart.xml b/entries/ajaxStart.xml index bf7fc14a7..3d8f4df4f 100644 --- a/entries/ajaxStart.xml +++ b/entries/ajaxStart.xml @@ -1,15 +1,21 @@ - - .ajaxStart() + + ajaxStart event + Register a handler to be called when the first Ajax request begins. This is an Ajax Event. - 1.0 + 1.7 + + The string "ajaxStart". + The function to be invoked. - Register a handler to be called when the first Ajax request begins. This is an Ajax Event. -

Whenever an Ajax request is about to be sent, jQuery checks whether there are any other outstanding Ajax requests. If none are in progress, jQuery triggers the ajaxStart event. Any and all handlers that have been registered with the .ajaxStart() method are executed at this time.

+
+

This page describes the ajaxStart event. For the deprecated .ajaxStart() method, see .ajaxStart().

+
+

Whenever an Ajax request is about to be sent, jQuery checks whether there are any other outstanding Ajax requests. If none are in progress, jQuery triggers the ajaxStart event. Any and all handlers that have been registered with .on( "ajaxStart", ... ) are executed at this time.

To observe this method in action, set up a basic Ajax load request:


 <div class="trigger">Trigger</div>
@@ -18,28 +24,29 @@
     

Attach the event handler to any element:


-$( document ).ajaxStart(function() {
+$( document ).on( "ajaxStart", function() {
   $( ".log" ).text( "Triggered ajaxStart handler." );
-});
+} );
     

Now, make an Ajax request using any jQuery method:


-$( ".trigger" ).click(function() {
+$( ".trigger" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
-});
+} );
     

When the user clicks the element with class trigger and the Ajax request is sent, the log message is displayed.

- - + + Show a loading message whenever an Ajax request starts (and none is already active). +
diff --git a/entries/ajaxStop-shorthand.xml b/entries/ajaxStop-shorthand.xml new file mode 100644 index 000000000..781216575 --- /dev/null +++ b/entries/ajaxStop-shorthand.xml @@ -0,0 +1,19 @@ + + + .ajaxStop() + Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + + 1.0 + + The function to be invoked. + + + +
+

This API is deprecated. Use .on( "ajaxStop", handler ) instead.

+
+
+ + + +
diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index 073dd208f..f42c74448 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -1,15 +1,21 @@ - - .ajaxStop() + + ajaxStop event Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. - 1.0 + 1.7 + + The string "ajaxStop". + The function to be invoked. -

Whenever an Ajax request completes, jQuery checks whether there are any other outstanding Ajax requests. If none remain, jQuery triggers the ajaxStop event. Any and all handlers that have been registered with the .ajaxStop() method are executed at this time. The ajaxStop event is also triggered if the last outstanding Ajax request is cancelled by returning false within the beforeSend callback function.

+
+

This page describes the ajaxStop event. For the deprecated .ajaxStop() method, see .ajaxStop().

+
+

Whenever an Ajax request completes, jQuery checks whether there are any other outstanding Ajax requests. If none remain, jQuery triggers the ajaxStop event. Any and all registered ajaxStop handlers are executed at this time. The ajaxStop event is also triggered if the last outstanding Ajax request is cancelled by returning false within the beforeSend callback function.

To observe this method in action, set up a basic Ajax load request:


 <div class="trigger">Trigger</div>
@@ -18,28 +24,29 @@
     

Attach the event handler to the document:


-$( document ).ajaxStop(function() {
+$( document ).on( "ajaxStop", function() {
   $( ".log" ).text( "Triggered ajaxStop handler." );
-});
+} );
     

Now, make an Ajax request using any jQuery method:


-$( ".trigger" ).click(function() {
+$( ".trigger" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
-});
+} );
     

When the user clicks the element with class trigger and the Ajax request completes, the log message is displayed.

- - + + Hide a loading message after all the Ajax requests have stopped. +
diff --git a/entries/ajaxSuccess-shorthand.xml b/entries/ajaxSuccess-shorthand.xml new file mode 100644 index 000000000..a9e543350 --- /dev/null +++ b/entries/ajaxSuccess-shorthand.xml @@ -0,0 +1,19 @@ + + + .ajaxSuccess() + Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + + 1.0 + + The function to be invoked. + + + +
+

This API is deprecated. Use .on( "ajaxSuccess", handler ) instead.

+
+
+ + + +
diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml index 840ec0287..8824a6212 100644 --- a/entries/ajaxSuccess.xml +++ b/entries/ajaxSuccess.xml @@ -1,8 +1,12 @@ - - .ajaxSuccess() + + ajaxSuccess event + Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. - 1.0 + 1.7 + + The string "ajaxSuccess". + The function to be invoked. @@ -11,9 +15,11 @@ - Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. -

Whenever an Ajax request completes successfully, jQuery triggers the ajaxSuccess event. Any and all handlers that have been registered with the .ajaxSuccess() method are executed at this time.

+
+

This page describes the ajaxSuccess event. For the deprecated .ajaxSuccess() method, see .ajaxSuccess().

+
+

Whenever an Ajax request completes successfully, jQuery triggers the ajaxSuccess event. Any and all registered ajaxSuccess handlers are executed at this time.

To observe this method in action, set up a basic Ajax load request:


 <div class="trigger">Trigger</div>
@@ -22,38 +28,39 @@
     

Attach the event handler to any element:


-$(document).ajaxSuccess(function() {
+$( document ).on( "ajaxSuccess", function() {
   $( ".log" ).text( "Triggered ajaxSuccess handler." );
-});
+} );
     

Now, make an Ajax request using any jQuery method:


 $( ".trigger" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
-});
+} );
     

When the user clicks the element with class trigger and the Ajax request completes successfully, the log message is displayed.

All ajaxSuccess handlers are invoked, regardless of what Ajax request was completed. If you must differentiate between the requests, you can use the parameters passed to the handler. Each time an ajaxSuccess handler is executed, it is passed the event object, the XMLHttpRequest object, and the settings object that was used in the creation of the request. For example, you can restrict the callback to only handling events dealing with a particular URL:


-$( document ).ajaxSuccess(function( event, xhr, settings ) {
+$( document ).on( "ajaxSuccess", function( event, xhr, settings ) {
   if ( settings.url == "ajax/test.html" ) {
     $( ".log" ).text( "Triggered ajaxSuccess handler. The Ajax response was: " +
       xhr.responseText );
   }
-});
+} );
     

Note: You can get the returned Ajax contents by looking at xhr.responseXML or xhr.responseText for xml and html respectively.

- - + + Show a message when an Ajax request completes successfully. +
diff --git a/entries/andSelf.xml b/entries/andSelf.xml index 5adfd1aea..967c72ef5 100644 --- a/entries/andSelf.xml +++ b/entries/andSelf.xml @@ -6,72 +6,10 @@ Add the previous set of elements on the stack to the current set. -

Note: This function has been deprecated and is now an alias for .addBack(), which should be used with jQuery 1.8 and later.

-

As described in the discussion for .end(), jQuery objects maintain an internal stack that keeps track of changes to the matched set of elements. When one of the DOM traversal methods is called, the new set of elements is pushed onto the stack. If the previous set of elements is desired as well, .andSelf() can help.

-

Consider a page with a simple list on it:

-

-<ul>
-  <li>list item 1</li>
-  <li>list item 2</li>
-  <li class="third-item">list item 3</li>
-  <li>list item 4</li>
-  <li>list item 5</li>
-</ul>
-    
-

The result of the following code is a red background behind items 3, 4 and 5:

-

-$( "li.third-item" ).nextAll().andSelf()
-  .css( "background-color", "red" );
-    
-

First, the initial selector locates item 3, initializing the stack with the set containing just this item. The call to .nextAll() then pushes the set of items 4 and 5 onto the stack. Finally, the .andSelf() invocation merges these two sets together, creating a jQuery object that points to all three items in document order: [ <li.third-item>, <li>, <li> ].

+
+

Note: This API has been removed in jQuery 3.0; use .addBack() instead, which should work identically.

+
- - The .andSelf() method causes the previous set of DOM elements in the traversal stack to be added to the current set. In the first example, the top stack contains the set resulting from .find("p"). In the second example, .andSelf() adds the previous set of elements on the stack — in this case $( "div.after-andself" ) — to the current set, selecting both the div and its enclosed paragraphs. - - - - diff --git a/entries/animate.xml b/entries/animate.xml index 5db2dcf6e..c4ac9e70f 100644 --- a/entries/animate.xml +++ b/entries/animate.xml @@ -45,7 +45,7 @@

To animate the opacity, left offset, and height of the image simultaneously:


-$( "#clickme" ).click(function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).animate({
     opacity: 0.25,
     left: "+=50",
@@ -72,10 +72,10 @@ $( "#clickme" ).click(function() {
     

The opacity of the image is already at its target value, so this property is not animated by the second click. Since the target value for left is a relative value, the image moves even farther to the right during this second animation.

Directional properties (top, right, bottom, left) have no discernible effect on elements if their position style property is static, which it is by default.

-

Note: The jQuery UI project extends the .animate() method by allowing some non-numeric styles such as colors to be animated. The project also includes mechanisms for specifying animations through CSS classes rather than individual attributes.

+

Note: The jQuery UI project extends the .animate() method by allowing some non-numeric styles such as colors to be animated. The project also includes mechanisms for specifying animations through CSS classes rather than individual attributes.

-

Note: if attempting to animate an element with a height or width of 0px, where contents of the element are visible due to overflow, jQuery may clip this overflow during animation. By fixing the dimensions of the original element being hidden however, it is possible to ensure that the animation runs smoothly. A clearfix can be used to automatically fix the dimensions of your main element without the need to set this manually.

+

Note: if attempting to animate an element with a height or width of 0px, where contents of the element are visible due to overflow, jQuery may clip this overflow during animation. By fixing the dimensions of the original element being hidden however, it is possible to ensure that the animation runs smoothly. A clearfix can be used to automatically fix the dimensions of your main element without the need to set this manually.

Step Function

The second version of .animate() provides a step option — a callback function that is fired at each step of the animation. This function is useful for enabling custom animation types or altering the animation as it is occurring. It accepts two arguments (now and fx), and this is set to the DOM element being animated.

@@ -96,12 +96,12 @@ $( "li" ).animate({ });

Easing

-

The remaining parameter of .animate() is a string naming an easing function to use. An easing function specifies the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

+

The remaining parameter of .animate() is a string naming an easing function to use. An easing function specifies the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

Per-property Easing

As of jQuery version 1.4, you can set per-property easing functions within a single .animate() call. In the first version of .animate(), each property can take an array as its value: The first member of the array is the CSS property and the second member is an easing function. If a per-property easing function is not defined for a particular property, it uses the value of the .animate() method's optional easing argument. If the easing argument is not defined, the default swing function is used.

For example, to simultaneously animate the width and height with the swing easing function and the opacity with the linear easing function:


-$( "#clickme" ).click(function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).animate({
     width: [ "toggle", "swing" ],
     height: [ "toggle", "swing" ],
@@ -113,7 +113,7 @@ $( "#clickme" ).click(function() {
     

In the second version of .animate(), the options object can include the specialEasing property, which is itself an object of CSS properties and their corresponding easing functions. For example, to simultaneously animate the width using the linear easing function and the height using the easeOutBounce easing function:


-$( "#clickme" ).click(function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).animate({
     width: "toggle",
     height: "toggle"
@@ -137,7 +137,7 @@ $( "#clickme" ).click(function() {
     
@@ -191,7 +191,7 @@ $( "#left" ).click(function(){
 
 The second button starts a traditional chained animation, where each animation will start once the previous animation on the element has completed.
     
       
diff --git a/entries/blur-shorthand.xml b/entries/blur-shorthand.xml
new file mode 100644
index 000000000..589a1cebb
--- /dev/null
+++ b/entries/blur-shorthand.xml
@@ -0,0 +1,37 @@
+
+
+  .blur()
+  Bind an event handler to the "blur" event, or trigger that event on an element.
+  
+    1.0
+    
+      A function to execute each time the event is triggered.
+      
+    
+  
+  
+    1.4.3
+    
+      An object containing data that will be passed to the event handler.
+    
+    
+      A function to execute each time the event is triggered.
+      
+    
+  
+  
+    1.0
+  
+  
+    
+

This API is deprecated.

+

Instead of .blur( handler ) or .blur( eventData, handler ), use .on( "blur", handler ) or .on( "blur", eventData, handler ), respectively.

+

Instead of .blur(), use .trigger( "blur" ).

+
+
+ + + + + +
diff --git a/entries/blur.xml b/entries/blur.xml index 11afbd6ab..68636a0ce 100644 --- a/entries/blur.xml +++ b/entries/blur.xml @@ -1,16 +1,15 @@ - - .blur() - Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. + + +Bind an event handler to the "blur" event, or trigger that event on an element. + + blur event + Bind an event handler to the "blur" event. - 1.0 - - A function to execute each time the event is triggered. - + 1.7 + + The string "blur". - - - 1.4.3 An object containing data that will be passed to the event handler. @@ -19,11 +18,10 @@ - - 1.0 - -

This method is a shortcut for .on( "blur", handler ) in the first two variations, and .trigger( "blur" ) in the third.

+
+

This page describes the blur event. For the deprecated .blur() method, see .blur().

+

The blur event is sent to an element when it loses focus. Originally, this event was only applicable to form elements, such as <input>. In recent browsers, the domain of the event has been extended to include all element types. An element can lose focus via keyboard commands, such as the Tab key, or by mouse clicks elsewhere on the page.

For example, consider the HTML:


@@ -34,33 +32,55 @@
 <div id="other">
   Trigger the handler
 </div>
-The event handler can be bound to the first input field:
-$( "#target" ).blur(function() {
-  alert( "Handler for .blur() called." );
-});
+    
+

The event handler can be bound to the first input field:

+

+$( "#target" ).on( "blur", function() {
+  alert( "Handler for `blur` called." );
+} );
     

Now if the first field has the focus, clicking elsewhere or tabbing away from it displays the alert:

- Handler for .blur() called. + Handler for `blur` called.

-

To trigger the event programmatically, apply .blur() without an argument:

+

To trigger the event programmatically, call .trigger( "blur" ):


-$( "#other" ).click(function() {
-  $( "#target" ).blur();
-});
+$( "#other" ).on( "click", function() {
+  $( "#target" ).trigger( "blur" );
+} );
     

After this code executes, clicks on Trigger the handler will also alert the message.

-

The blur event does not bubble in Internet Explorer. Therefore, scripts that rely on event delegation with the blur event will not work consistently across browsers. As of version 1.4.2, however, jQuery works around this limitation by mapping blur to the focusout event in its event delegation methods, .live() and .delegate().

+

The blur event does not bubble. As of version 1.4.2, jQuery works around this limitation by mapping blur to the focusout event in its event delegation methods.

+

The native blur event is asynchronous in all versions of IE, contrary to other browsers. To avoid issues related to this discrepancy, as of jQuery 3.7.0, jQuery uses focusout as the native backing event for blur in IE.

- To trigger the blur event on all paragraphs: - + + +
+ + + blur event + Trigger the "blur" event on an element. + + 1.0 + + The string "blur". + + + +

See the description for .on( "blur", ... ).

+
+ + +
+ +
diff --git a/entries/button-selector.xml b/entries/button-selector.xml index 858522e5c..12c8471cd 100644 --- a/entries/button-selector.xml +++ b/entries/button-selector.xml @@ -16,9 +16,9 @@ var input = $( ":button" ).addClass( "marked" ); $( "div" ).text( "For this type jQuery found " + input.length + "." ); // Prevent the form from submitting -$( "form" ).submit(function( event ) { +$( "form" ).on( "submit", function( event ) { event.preventDefault(); -}); +} ); ]]> - + +
+ + + change event + Trigger the "change" event on an element. + + 1.0 + + The string "change". + + + +

See the description for .on( "change", ... ).

+
+ +
+ + diff --git a/entries/checkbox-selector.xml b/entries/checkbox-selector.xml index 843cdaf77..ba0fd815d 100644 --- a/entries/checkbox-selector.xml +++ b/entries/checkbox-selector.xml @@ -26,9 +26,9 @@ $( "div" ) .css( "color", "red" ); // Prevent the form from submitting -$( "form" ).submit(function( event ) { +$( "form" ).on( "submit", function( event ) { event.preventDefault(); -}); +} ); ]]> - Trigger the click event on all of the paragraphs on the page: + Trigger the click event on all the paragraphs on the page: - + + + + + click event + Trigger the "click" event on an element. + + 1.0 + + The string "click". + + + +

See the description for .on( "click", ... ).

+
+ +
+ + diff --git a/entries/contains-selector.xml b/entries/contains-selector.xml index e14882698..c471083f8 100644 --- a/entries/contains-selector.xml +++ b/entries/contains-selector.xml @@ -25,5 +25,6 @@ $( "div:contains('John')" ).css( "text-decoration", "underline" ); ]]> + diff --git a/entries/contents.xml b/entries/contents.xml index 5bfe9fc68..6cfa73bae 100644 --- a/entries/contents.xml +++ b/entries/contents.xml @@ -8,6 +8,7 @@

Given a jQuery object that represents a set of DOM elements, the .contents() method allows us to search through the immediate children of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .contents() and .children() methods are similar, except that the former includes text nodes and comment nodes as well as HTML elements in the resulting jQuery object. Please note that most jQuery operations don't support text nodes and comment nodes. The few that do will have an explicit note on their API documentation page.

The .contents() method can also be used to get the content document of an iframe, if the iframe is on the same domain as the main page.

+

As of jQuery 3.2, .contents() returns contents of <template> elements as well.

Consider a simple <div> with a number of text nodes, each of which is separated by two line break elements (<br>):


 <div class="container">
@@ -33,7 +34,7 @@ $( ".container" )
     .filter( "br" )
     .remove();
     
-

This code first retrieves the contents of <div class="container"> and then filters it for text nodes, which are wrapped in paragraph tags. This is accomplished by testing the .nodeType property of the element. This DOM property holds a numeric code indicating the node's type; text nodes use the code 3. The contents are again filtered, this time for <br /> elements, and these elements are removed.

+

This code first retrieves the contents of <div class="container"> and then filters it for text nodes, which are wrapped in paragraph tags. This is accomplished by testing the .nodeType property of the element. This DOM property holds a numeric code indicating the node's type; text nodes use the code 3. The contents are again filtered, this time for <br /> elements, and these elements are removed.

Find all the text nodes inside a paragraph and wrap them with a bold tag. @@ -46,7 +47,7 @@ $( "p" ) .wrap( "" ); ]]> @@ -55,9 +56,10 @@ $( "p" ) $( "#frameDemo" ).contents().find( "a" ).css( "background-color", "#BADA55" ); ]]> + diff --git a/entries/context.xml b/entries/context.xml index 5fc5362a7..cd9c3cc41 100644 --- a/entries/context.xml +++ b/entries/context.xml @@ -1,12 +1,14 @@ - + .context 1.3 The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. -

The .context property was deprecated in jQuery 1.10 and is only maintained to the extent needed for supporting .live() in the jQuery Migrate plugin. It may be removed without notice in a future version.

+
+

Note: This API has been removed in jQuery 3.0.

+

The .live() method for binding event handlers uses this property to determine the root element to use for its event delegation needs.

The value of this property is typically equal to document, as this is the default context for jQuery objects if none is supplied. The context may differ if, for example, the object was created by searching within an <iframe> or XML document.

Note that the context property may only apply to the elements originally selected by jQuery(), as it is possible for the user to add elements to the collection via methods such as .add() and these may have a different context.

@@ -18,13 +20,10 @@ $( "ul" ) .append( "
  • " + $( "ul" ).context + "
  • " ) .append( "
  • " + $( "ul", document.body ).context.nodeName + "
  • " ); ]]> - - +
    diff --git a/entries/contextmenu-shorthand.xml b/entries/contextmenu-shorthand.xml new file mode 100644 index 000000000..9b1f48736 --- /dev/null +++ b/entries/contextmenu-shorthand.xml @@ -0,0 +1,36 @@ + + + .contextmenu() + Bind an event handler to the "contextmenu" event, or trigger that event on an element. + + 1.0 + + A function to execute each time the event is triggered. + + + + + 1.4.3 + + An object containing data that will be passed to the event handler. + + + A function to execute each time the event is triggered. + + + + + 1.0 + + +
    +

    This API is deprecated.

    +

    Instead of .contextmenu( handler ) or .contextmenu( eventData, handler ), use .on( "contextmenu", handler ) or .on( "contextmenu", eventData, handler ), respectively.

    +

    Instead of .contextmenu(), use .trigger( "contextmenu" ).

    +
    +
    + + + + +
    diff --git a/entries/contextmenu.xml b/entries/contextmenu.xml index 0c8461692..63d9c179c 100644 --- a/entries/contextmenu.xml +++ b/entries/contextmenu.xml @@ -1,7 +1,10 @@ - - .contextmenu() - Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. + +Bind an event handler to the "contextmenu" event, or trigger that event on an element. + + + contextmenu event + Bind an event handler to the "contextmenu" event. 1.0 @@ -19,12 +22,11 @@ - - 1.0 - -

    This method is a shortcut for .on( "contextmenu", handler ) in the first two variations, and .trigger( "contextmenu" ) in the third. - The contextmenu event is sent to an element when the right button of the mouse is clicked on it, but before the context menu is displayed. In case the context menu key is pressed, the event is triggered on the html element. Any HTML element can receive this event. +

    +

    This page describes the contextmenu event. For the deprecated .contextmenu() method, see .contextmenu().

    +
    +

    The contextmenu event is sent to an element when the right button of the mouse is clicked on it, but before the context menu is displayed. In case the context menu key is pressed, the event is triggered on the html element or the currently focused element. Any HTML element can receive this event. For example, consider the HTML:

    
     <div id="target">
    @@ -33,35 +35,34 @@
         

    The event handler can be bound to the <div> as follows:

    
    -$( "#target" ).contextmenu(function() {
    -  alert( "Handler for .contextmenu() called." );
    -});
    +$( "#target" ).on( "contextmenu", function() {
    +  alert( "Handler for `contextmenu` called." );
    +} );
         

    Now right-clicking on this element displays the alert:

    - Handler for .contextmenu() called. + Handler for `contextmenu` called.

    -

    To trigger the event manually, call .contextmenu() without an argument:

    +

    To trigger the event manually, use .trigger( "contextmenu" ):

    
    -$( "#target" ).contextmenu();
    +$( "#target" ).trigger( "contextmenu" );
         
    - To show a "Hello World!" alert box when the contextmenu event is triggered on a paragraph on the page: Right click to toggle background color. .

    +

    As of jQuery 3.2, CSS Custom Properties (also called CSS Variables) are supported: $( "p" ).css( "--custom-property" ). Note that you need to provide the property name as-is, camelCasing it won't work as it does for regular CSS properties.

    Get the background color of a clicked div. + +
    @@ -128,7 +131,7 @@ $( "div" ).click(function() { A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. - + @@ -144,9 +147,17 @@ $( "div" ).click(function() {

    As with the .prop() method, the .css() method makes setting properties of elements quick and easy. This method can take either a property name and value as separate parameters, or a single object of key-value pairs.

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css({ "background-color": "#ffe", "border-left": "5px solid #ccc" }) and .css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" }). Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.

    -

    When a number is passed as the value, jQuery will convert it to a string and add px to the end of that string. If the property requires units other than px, convert the value to a string and add the appropriate units before calling the method.

    +

    In jQuery 3.x or older, when a number is passed as the value, jQuery will convert it to a string and add px to the end of that string. However, there are exceptions. px is not added to keys of jQuery.cssNumber If the property requires units other than px, convert the value to a string and add the appropriate units before calling the method.

    +

    In jQuery 4.0 or newer, when a number is passed as the value, jQuery will only convert it to a string and add px to the end of that string for a limited set of properties - mostly related to width, height, border, margin & padding; the full list:

    +
      +
    • setting the element position: top, right, bottom, left
    • +
    • setting the element dimensions: width, height, min-width, min-height, max-width, max-height
    • +
    • padding-related: padding, padding-top, padding-right, padding-bottom, padding-left
    • +
    • margin-related: margin, margin-top, margin-right, margin-bottom, margin-left
    • +
    • border-related: border, border-width, border-top, border-top-width, border-right, border-right-width, border-bottom, border-bottom-width, border-left, border-left-width
    • +

    When using .css() as a setter, jQuery modifies the element's style property. For example, $( "#mydiv" ).css( "color", "green" ) is equivalent to document.getElementById( "mydiv" ).style.color = "green". Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. As a consequence, the element's style for that property will be restored to whatever value was applied. So, this method can be used to cancel any style modification you have previously performed. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

    -

    Note: .css() ignores !important declarations. So, the statement $( "p" ).css( "color", "red !important" ) does not turn the color of all paragraphs in the page to red. It's strongly advised to use classes instead; otherwise use a jQuery plugin.

    +

    Note: .css() doesn't support !important declarations. So, the statement $( "p" ).css( "color", "red !important" ) does not turn the color of all paragraphs in the page to red as of jQuery 3.6.0. Do not depend on that not working, though, as a future version of jQuery may add support for such declarations. It's strongly advised to use classes instead; otherwise use a jQuery plugin.

    As of jQuery 1.8, the .css() setter will automatically take care of prefixing the property name. For example, take .css( "user-select", "none" ) in Chrome/Safari will set it as -webkit-user-select, Firefox will use -moz-user-select, and IE10 will use -ms-user-select.

    As of jQuery 1.6, .css() accepts relative values similar to .animate(). Relative values are a string starting with += or -= to increment or decrement the current value. For example, if an element's padding-left was 10px, .css( "padding-left", "+=15" ) would result in a total padding-left of 25px.

    As of jQuery 1.4, .css() allows us to pass a function as the property value:

    @@ -157,6 +168,7 @@ $( "div.example" ).css( "width", function( index ) {

    This example sets the widths of the matched elements to incrementally larger values.

    Note: If nothing is returned in the setter function (ie. function( index, style ){} ), or if undefined is returned, the current value is not changed. This is useful for selectively setting values only when certain criteria are met.

    +

    As of jQuery 3.2, CSS Custom Properties (also called CSS Variables) are supported: $( "p" ).css( "--custom-property", "value" ). Note that you need to provide the property name as-is, camelCasing it won't work as it does for regular CSS properties.

    Change the color of any paragraph to red on mouseover event. @@ -282,5 +294,7 @@ $( "div" ).on( "click", function() { + + diff --git a/entries/data.xml b/entries/data.xml index 3606395df..d998d38c7 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -24,14 +24,14 @@

    We can set several distinct values for a single element and retrieve them later:

    
     $( "body" ).data( "foo", 52 );
    -$( "body" ).data( "bar", { myType: "test", count: 40 } );
    +$( "body" ).data( "bar", { isManual: true } );
     $( "body" ).data( { baz: [ 1, 2, 3 ] } );
     $( "body" ).data( "foo" ); // 52
    -$( "body" ).data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1, 2, 3 ] }
    +$( "body" ).data(); // { foo: 52, bar: { isManual: true }, baz: [ 1, 2, 3 ] }
           
    -

    In jQuery 1.4.3 setting an element's data object with .data(obj) extends the data previously stored with that element.

    -

    Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

    -

    jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

    +

    Using the data() method to update data does not affect attributes in the DOM. To set a data-* attribute value, use attr.

    +

    Prior to jQuery 1.4.3, .data( obj ) completely replaced all data. Since jQuery 1.4.3, data is instead extended by shallow merge.

    +

    Since jQuery 3, every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter in a key is replaced by the uppercase version of the letter, in alignment with the HTML dataset API. A statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

    Due to the way browsers interact with plugins and external code, the .data() method cannot be used on <object> (unless it's a Flash plugin), <applet> or <embed> elements.

    @@ -40,8 +40,8 @@ $( "body" ).data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1, Store then retrieve a value from the div element. $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

    +

    Calling .data() with no parameters returns a JavaScript object containing each stored value as a property. The object can be used directly to get data values (but note that property names originally containing dashes will have been modified as described below).

    +

    Since jQuery 3, every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter in a key is replaced by the uppercase version of the letter, in alignment with the HTML dataset API. A statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

    - HTML5 data-* Attributes + HTML5 data-* Attributes

    -

    As of jQuery 1.4.3 HTML 5 data- attributes will be automatically pulled in to jQuery's data object. The treatment of attributes with embedded dashes was changed in jQuery 1.6 to conform to the W3C HTML5 specification.

    +

    Since jQuery 1.4.3, data-* attributes are used to initialize jQuery data. An element's data-* attributes are retrieved the first time the data() method is invoked upon it, and then are no longer accessed or mutated (all values are stored internally by jQuery).

    +

    Every attempt is made to convert the attribute's string value to a JavaScript value (this includes booleans, numbers, objects, arrays, and null). A string is only converted to a number if doing so doesn't change its representation (for example, the string "100" is converted to the number 100, but "1E02" and "100.000" are left as strings because their numeric value of 100 serializes to "100"). When a string starts with '{' or '[', then jQuery.parseJSON is used to parse it; it must follow valid JSON syntax including quoted property names. A string not parseable as a JavaScript value is not converted.

    +

    To retrieve a data-* attribute value as an unconverted string, use the attr() method.

    +

    Since jQuery 1.6, dashes in data-* attribute names have been processed in alignment with the HTML dataset API.

    For example, given the following HTML:

    <div data-role="page" data-last-value="43" data-hidden="true" data-options='{"name":"John"}'></div>
    -

    All of the following jQuery code will work.

    +

    The following comparisons are all true:

    
     $( "div" ).data( "role" ) === "page";
     $( "div" ).data( "lastValue" ) === 43;
     $( "div" ).data( "hidden" ) === true;
     $( "div" ).data( "options" ).name === "John";
           
    -

    The second statement of the code above correctly refers to the data-last-value attribute of the element. In case no data is stored with the passed key, jQuery searches among the attributes of the element, converting a camel-cased string into a dashed string and then prepending data- to the result. So, the string lastValue is converted to data-last-value.

    -

    Every attempt is made to convert the string to a JavaScript value (this includes booleans, numbers, objects, arrays, and null). A value is only converted to a number if doing so doesn't change the value's representation. For example, "1E02" and "100.000" are equivalent as numbers (numeric value 100) but converting them would alter their representation so they are left as strings. The string value "100" is converted to the number 100.

    -

    When the data attribute is an object (starts with '{') or array (starts with '[') then jQuery.parseJSON is used to parse the string; it must follow valid JSON syntax including quoted property names. If the value isn't parseable as a JavaScript value, it is left as a string.

    -

    To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method.

    -

    The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).

    -

    Calling .data() with no parameters retrieves all of the values as a JavaScript object. This object can be safely cached in a variable as long as a new object is not set with .data(obj). Using the object directly to get or set values is faster than making individual calls to .data() to get or set each value:

    -
    
    -var mydata = $( "#mydiv" ).data();
    -if ( mydata.count < 9 ) {
    -  mydata.count = 43;
    -  mydata.status = "embiggened";
    -}
    -    
    Get the data named "blah" stored at for an element. Double click to toggle background color. diff --git a/entries/dequeue.xml b/entries/dequeue.xml index 7caca4e36..c54401c78 100644 --- a/entries/dequeue.xml +++ b/entries/dequeue.xml @@ -14,7 +14,7 @@ Use dequeue to end a custom queue function which allows the queue to keep going. - - - + + + + + error event + Trigger the "error" event on an element. + + 1.0 + + The string "error". + + + +

    See the description for .on( "error", ... ).

    +
    + +
    + + diff --git a/entries/even-selector.xml b/entries/even-selector.xml index f190e0667..bfc8038a3 100644 --- a/entries/even-selector.xml +++ b/entries/even-selector.xml @@ -1,12 +1,15 @@ - + :even Selector :even 1.0 - Selects even elements, zero-indexed. See also odd. + Selects even elements, zero-indexed. See also :odd. +
    +

    As of jQuery 3.4, the :even pseudo-class is deprecated. Remove it from your selectors and filter the results later using .even() (available in jQuery 3.5.0 or newer).

    +

    In particular, note that the 0-based indexing means that, counter-intuitively, :even selects the first element, third element, and so on within the matched set.

    @@ -33,4 +36,5 @@ $( "tr:even" ).css( "background-color", "#bbf" ); +
    diff --git a/entries/even.xml b/entries/even.xml new file mode 100644 index 000000000..cecff9e42 --- /dev/null +++ b/entries/even.xml @@ -0,0 +1,47 @@ + + + .even() + + 3.5 + + Reduce the set of matched elements to the even ones in the set, numbered from zero. + +

    Given a jQuery object that represents a set of DOM elements, the .even() method constructs a new jQuery object from the even elements in that set. Counting starts from zero!

    +

    Consider a page with a simple list on it:

    +
    
    +<ul>
    +  <li>list item 1</li>
    +  <li>list item 2</li>
    +  <li>list item 3</li>
    +  <li>list item 4</li>
    +  <li>list item 5</li>
    +</ul>
    +    
    +

    We can apply this method to the set of list items:

    +
    
    +$( "li" ).even().css( "background-color", "red" );
    +    
    +

    The result of this call is a red background for the first, third & 5th items.

    +
    + + Highlight the even items in a list. + + + + + + +
    diff --git a/entries/event.currentTarget.xml b/entries/event.currentTarget.xml index f70a8626d..859cb8d41 100644 --- a/entries/event.currentTarget.xml +++ b/entries/event.currentTarget.xml @@ -14,11 +14,11 @@ Alert that currentTarget matches the `this` keyword. -
    \ No newline at end of file + diff --git a/entries/event.isDefaultPrevented.xml b/entries/event.isDefaultPrevented.xml index 676b31f3b..d9ada3149 100644 --- a/entries/event.isDefaultPrevented.xml +++ b/entries/event.isDefaultPrevented.xml @@ -9,7 +9,7 @@ Checks whether event.preventDefault() was called. diff --git a/entries/event.namespace.xml b/entries/event.namespace.xml index ed661c920..bbebcda4d 100644 --- a/entries/event.namespace.xml +++ b/entries/event.namespace.xml @@ -14,7 +14,7 @@ $( "p" ).on( "test.something", function( event ) { alert( event.namespace ); }); -$( "button" ).click(function( event ) { +$( "button" ).on( "click", function( event ) { $( "p" ).trigger( "test.something" ); }); ]]> diff --git a/entries/event.preventDefault.xml b/entries/event.preventDefault.xml index 68f0a43ac..82b4e1047 100644 --- a/entries/event.preventDefault.xml +++ b/entries/event.preventDefault.xml @@ -11,7 +11,7 @@ Cancel the default action (navigation) of the click. diff --git a/entries/event.relatedTarget.xml b/entries/event.relatedTarget.xml index 97908df75..e4ee9eafa 100644 --- a/entries/event.relatedTarget.xml +++ b/entries/event.relatedTarget.xml @@ -11,9 +11,9 @@ On mouseout of anchors, alert the element type being entered. diff --git a/entries/event.result.xml b/entries/event.result.xml index fa5cd9adc..40bd18724 100644 --- a/entries/event.result.xml +++ b/entries/event.result.xml @@ -11,10 +11,10 @@ Display previous handler's return value diff --git a/entries/event.stopImmediatePropagation.xml b/entries/event.stopImmediatePropagation.xml index e5b53eba9..dd86bd7cc 100644 --- a/entries/event.stopImmediatePropagation.xml +++ b/entries/event.stopImmediatePropagation.xml @@ -25,14 +25,14 @@ } ]]>
    @@ -40,7 +40,7 @@ function handler( event ) { target.children().toggle(); } } -$( "ul" ).click( handler ).find( "ul" ).hide(); +$( "ul" ).on( "click", handler ).find( "ul" ).hide(); ]]> diff --git a/entries/event.which.xml b/entries/event.which.xml index 1d36d5277..e8e6aa28b 100644 --- a/entries/event.which.xml +++ b/entries/event.which.xml @@ -6,7 +6,7 @@ For key or mouse events, this property indicates the specific key or button that was pressed. -

    The event.which property normalizes event.keyCode and event.charCode. It is recommended to watch event.which for keyboard key input. For more detail, read about event.charCode on the MDN.

    +

    The event.which property normalizes event.keyCode and event.charCode. It is recommended to watch event.which for keyboard key input. For more detail, read about event.charCode on the MDN.

    event.which also normalizes button presses (mousedown and mouseupevents), reporting 1 for left button, 2 for middle, and 3 for right. Use event.which instead of event.button.

    diff --git a/entries/fadeIn.xml b/entries/fadeIn.xml index f3b2e9e2c..1975c039c 100644 --- a/entries/fadeIn.xml +++ b/entries/fadeIn.xml @@ -29,7 +29,7 @@ <img id="book" src="book.png" alt="" width="100" height="123"> // With the element initially hidden, we can show it slowly: -$( "#clickme" ).click(function() { +$( "#clickme" ).on( "click", function() { $( "#book" ).fadeIn( "slow", function() { // Animation complete }); @@ -43,7 +43,7 @@ $( "#clickme" ).click(function() {
    Figure 1 - Illustration of the fadeIn() effect

    Easing

    -

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    +

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Callback Function

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    @@ -52,9 +52,9 @@ $( "#clickme" ).click(function() { Animates hidden divs to fade in one by one, completing each animation within 600 milliseconds. @@ -76,7 +76,7 @@ $( "p" ).click(function() { Fades out spans in one section that you click on. @@ -128,26 +128,26 @@ var getPos = function( n ) { $( "p" ).each(function( n ) { var r = Math.floor( Math.random() * 3 ); var tmp = $( this ).text(); - $( this ).text( $( "p:eq(" + r + ")" ).text() ); - $( "p:eq(" + r + ")" ).text( tmp ); + $( this ).text( $( "p" ).eq( r ).text() ); + $( "p" ).eq( r ).text( tmp ); $( this ).css( "left", getPos( n ) ); -}); +} ); $( "div" ) .each(function( n ) { $( this ).css( "left", getPos( n ) ); - }) + } ) .css( "cursor", "pointer" ) - .click( function() { + .on( "click", function() { $( this ).fadeTo( 250, 0.25, function() { $( this ) .css( "cursor", "" ) .prev() - .css({ + .css( { "font-weight": "bolder", "font-style": "italic" - }); - }); - }); + } ); + } ); + } ); ]]> diff --git a/entries/focus-shorthand.xml b/entries/focus-shorthand.xml new file mode 100644 index 000000000..a38f4c280 --- /dev/null +++ b/entries/focus-shorthand.xml @@ -0,0 +1,37 @@ + + + .focus() + Bind an event handler to the "focus" event, or trigger that event on an element. + + 1.0 + + A function to execute each time the event is triggered. + + + + + 1.4.3 + + An object containing data that will be passed to the event handler. + + + A function to execute each time the event is triggered. + + + + + 1.0 + + +
    +

    This API is deprecated.

    +

    Instead of .focus( handler ) or .focus( eventData, handler ), use .on( "focus", handler ) or .on( "focus", eventData, handler ), respectively.

    +

    Instead of .focus(), use .trigger( "focus" ).

    +
    +
    + + + + + +
    diff --git a/entries/focus.xml b/entries/focus.xml index 1db6b6437..c9736a295 100644 --- a/entries/focus.xml +++ b/entries/focus.xml @@ -1,16 +1,15 @@ - - .focus() - Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. + + +Bind an event handler to the "focus" event, or trigger that event on an element. + + focus event + Bind an event handler to the "focus" event. - 1.0 - - A function to execute each time the event is triggered. - + 1.7 + + The string "focus". - - - 1.4.3 An object containing data that will be passed to the event handler. @@ -19,17 +18,16 @@ - - 1.0 - +
    +

    This page describes the focus event. For the deprecated .focus() method, see .focus().

    +
      -
    • This method is a shortcut for .on( "focus", handler ) in the first and second variations, and .trigger( "focus" ) in the third.
    • The focus event is sent to an element when it gains focus. This event is implicitly applicable to a limited set of elements, such as form elements (<input>, <select>, etc.) and links (<a href>). In recent browser versions, the event can be extended to include all element types by explicitly setting the element's tabindex property. An element can gain focus via keyboard commands, such as the Tab key, or by mouse clicks on the element.
    • Elements with focus are usually highlighted in some way by the browser, for example with a dotted line surrounding the element. The focus is used to determine which element is the first to receive keyboard-related events.
    -

    Attempting to set focus to a hidden element causes an error in Internet Explorer. Take care to only use .focus() on elements that are visible. To run an element's focus event handlers without setting focus to the element, use .triggerHandler( "focus" ) instead of .focus().

    +

    Attempting to set focus to a hidden element causes an error in Internet Explorer. Take care to only use .trigger( "focus" ) on elements that are visible. To run an element's focus event handlers without setting focus to the element, use .triggerHandler( "focus" ) instead of .trigger( "focus" ).

    For example, consider the HTML:

    
    @@ -43,24 +41,24 @@
         

    The event handler can be bound to the first input field:

    
    -$( "#target" ).focus(function() {
    -  alert( "Handler for .focus() called." );
    -});
    +$( "#target" ).on( "focus", function() {
    +  alert( "Handler for `focus` called." );
    +} );
         

    Now clicking on the first field, or tabbing to it from another field, displays the alert:

    - Handler for .focus() called. + Handler for `focus` called.

    We can trigger the event when another element is clicked:

    
    -$( "#other" ).click(function() {
    -  $( "#target" ).focus();
    -});
    +$( "#other" ).on( "click", function() {
    +  $( "#target" ).trigger( "focus" );
    +} );
         

    After this code executes, clicks on Trigger the handler will also alert the message.

    -

    The focus event does not bubble in Internet Explorer. Therefore, scripts that rely on event delegation with the focus event will not work consistently across browsers. As of version 1.4.2, however, jQuery works around this limitation by mapping focus to the focusin event in its event delegation methods, .live() and .delegate().

    +

    The focus event does not bubble. As of version 1.4.2, jQuery works around this limitation by mapping focus to the focusin event in its event delegation methods.

    +

    The native focus event is asynchronous in all versions of IE, contrary to other browsers. To avoid issues related to this discrepancy, as of jQuery 3.7.0, jQuery uses focusin as the native backing event for focus in IE.

    - Fire focus. To focus on a login input box with id 'login' on page startup, try: - + + +
    + + + focus event + Trigger the "focus" event on an element. + + 1.0 + + The string "focus". + + + +

    See the description for .on( "focus", ... ).

    +
    + + +
    + +
    diff --git a/entries/focusin-shorthand.xml b/entries/focusin-shorthand.xml new file mode 100644 index 000000000..ff8f548ed --- /dev/null +++ b/entries/focusin-shorthand.xml @@ -0,0 +1,37 @@ + + + .focusin() + Bind an event handler to the "focusin" event, or trigger that event on an element. + + 1.0 + + A function to execute each time the event is triggered. + + + + + 1.4.3 + + An object containing data that will be passed to the event handler. + + + A function to execute each time the event is triggered. + + + + + 1.0 + + +
    +

    This API is deprecated.

    +

    Instead of .focusin( handler ) or .focusin( eventData, handler ), use .on( "focusin", handler ) or .on( "focusin", eventData, handler ), respectively.

    +

    Instead of .focusin(), use .trigger( "focusin" ).

    +
    +
    + + + + + +
    diff --git a/entries/focusin.xml b/entries/focusin.xml index aaff429dc..7b5288f67 100644 --- a/entries/focusin.xml +++ b/entries/focusin.xml @@ -1,16 +1,15 @@ - - .focusin() + + +Bind an event handler to the "focusin" event, or trigger that event on an element. + + focusin event Bind an event handler to the "focusin" event. - 1.4 - - A function to execute each time the event is triggered. - + 1.7 + + The string "focusin". - - - 1.4.3 An object containing data that will be passed to the event handler. @@ -19,15 +18,13 @@ - - 1.0 - -

    This method is a shortcut for .on( "focusin", handler ) in the first two variations, and .trigger( "focusin" ) in the third.

    +
    +

    This page describes the focusin event. For the deprecated .focusin() method, see .focusin().

    +

    The focusin event is sent to an element when it, or any element inside of it, gains focus. This is distinct from the focus event in that it supports detecting the focus event on parent elements (in other words, it supports event bubbling).

    This event will likely be used together with the focusout event.

    - Watch for a focus to occur within the paragraphs on the page.
    diff --git a/entries/hidden-selector.xml b/entries/hidden-selector.xml index 47c0bf6ce..44b8397c6 100644 --- a/entries/hidden-selector.xml +++ b/entries/hidden-selector.xml @@ -18,7 +18,7 @@

    Elements that are not in a document are not considered to be visible; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    This selector is the opposite of the :visible selector. So, every element selected by :hidden isn't selected by :visible and vice versa.

    During animations to show an element, the element is considered to be visible at the start of the animation.

    -

    How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

    +

    How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

    jQuery 3 slightly modifies the meaning of :hidden (and therefore of :visible). Starting with this version, elements will be considered :hidden if they don't have any layout boxes. For example, br elements and inline elements with no content will not be selected by the :hidden selector.

    @@ -29,9 +29,9 @@ // In some browsers :hidden includes head, title, script, etc... var hiddenElements = $( "body" ).find( ":hidden" ).not( "script" ); -$( "span:first" ).text( "Found " + hiddenElements.length + " hidden elements total." ); +$( "span" ).first().text( "Found " + hiddenElements.length + " hidden elements total." ); $( "div:hidden" ).show( 3000 ); -$( "span:last" ).text( "Found " + $( "input:hidden" ).length + " hidden inputs." ); +$( "span" ).last().text( "Found " + $( "input:hidden" ).length + " hidden inputs." ); ]]> @@ -101,13 +101,13 @@ $( "button" ).click(function() { Animates all spans (words in this case) to hide fastly, completing each animation within 200 milliseconds. Once each animation is done, it starts the next one. @@ -134,7 +134,7 @@ $( "#shower" ).click(function() { for ( var i = 0; i < 5; i++ ) { $( "
    " ).appendTo( document.body ); } -$( "div" ).click(function() { +$( "div" ).on( "click", function() { $( this ).hide( 2000, function() { $( this ).remove(); }); diff --git a/entries/hover.xml b/entries/hover.xml index 3eb38753b..a924d368f 100644 --- a/entries/hover.xml +++ b/entries/hover.xml @@ -1,7 +1,7 @@ Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. - + .hover() Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. @@ -16,12 +16,15 @@ +
    +

    This API is deprecated. Use .on( "mouseenter", handlerIn ).on( "mouseleave", handlerOut ) instead.

    +

    The .hover() method binds handlers for both mouseenter and mouseleave events. You can use it to simply apply behavior to an element during the time the mouse is within the element.

    Calling $( selector ).hover( handlerIn, handlerOut ) is shorthand for:

    
    -$( selector ).mouseenter( handlerIn ).mouseleave( handlerOut );
    +$( selector ).on( "mouseenter", handlerIn ).on( "mouseleave", handlerOut );
           
    -

    See the discussions for .mouseenter() and .mouseleave() for more details.

    +

    See the discussions for mouseenter and mouseleave for more details.

    To add a special style to list items that are being hovered over, try: @@ -30,7 +33,7 @@ $( "li" ).hover( function() { $( this ).append( $( " ***" ) ); }, function() { - $( this ).find( "span:last" ).remove(); + $( this ).find( "span" ).last().remove(); } ); @@ -80,8 +83,10 @@ $( "td" ).off( "mouseenter mouseleave" ); +
    - + + Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. 1.4 @@ -91,21 +96,24 @@ $( "td" ).off( "mouseenter mouseleave" ); +
    +

    This API is deprecated. Use .on( "mouseenter mouseleave", handlerInOut ) instead.

    +

    The .hover() method, when passed a single function, will execute that handler for both mouseenter and mouseleave events. This allows the user to use jQuery's various toggle methods within the handler or to respond differently within the handler depending on the event.type.

    Calling $(selector).hover(handlerInOut) is shorthand for:

    
     $( selector ).on( "mouseenter mouseleave", handlerInOut );
           
    -

    See the discussions for .mouseenter() and .mouseleave() for more details.

    +

    See the discussions for mouseenter and mouseleave for more details.

    Slide the next sibling LI up or down on hover, and toggle a class. + + + +
    diff --git a/entries/jQuery.Deferred.getErrorHook.xml b/entries/jQuery.Deferred.getErrorHook.xml new file mode 100644 index 000000000..b20f98e8e --- /dev/null +++ b/entries/jQuery.Deferred.getErrorHook.xml @@ -0,0 +1,29 @@ + + + jQuery.Deferred.getErrorHook() + + 3.7 + + Return an Error instance with a defined stack. + +
    +

    Note: This API is not defined by default, but jQuery will make use of it when defined.

    +
    +

    When jQuery.Deferred.getErrorHook is defined, it extends the jQuery.Deferred features added in jQuery 3.0 to include an error captured before the async barrier whenever a Deferred throws an exception. This makes it easier to find programming errors that occur inside Deferreds. You can find an example implementation you can copy-paste below, or you can use jquery-deferred-reporter plugin.

    +
    
    +jQuery.Deferred.getErrorHook = function() {
    +  try {
    +    throw new Error( "Exception in jQuery.Deferred" );
    +  } catch ( err ) {
    +    return err;
    +  }
    +};
    +    
    +

    When defined, an error returned by this API is passed to jQuery.Deferred.exceptionHook as the second parameter.

    +

    Why does this API exist?

    +

    Prior to jQuery 3.0, Deferreds would simply terminate and the browser would generate a message on the console if an exception occurred such as attempting to call an undefined method as a function (e.g., myobject.missingFunction()). As of version 3.0, jQuery.Deferred follows the Promise/A+ specification when you use the .then method. The spec requires all errors to be trapped by the Promise, which prevents console errors from being logged. If the user has forgotten to add a handler for rejected promises, this can result in the error being silently swallowed with no notification at all!

    +

    The native Promise object as implemented in the browser tracks Promise rejections and reports problems on the console. However, doing the same type of reporting in the JavaScript world is much more difficult. jQuery itself is unable to use the native Promise because jQuery.Deferred implements a superset of Promise that requires additional features for methods like .done or .fail, and because Promise is not implemented on all the platforms that jQuery supports.

    +
    + + +
    diff --git a/entries/jQuery.Deferred.getStackHook.xml b/entries/jQuery.Deferred.getStackHook.xml new file mode 100644 index 000000000..87ee61387 --- /dev/null +++ b/entries/jQuery.Deferred.getStackHook.xml @@ -0,0 +1,30 @@ + + + jQuery.Deferred.getStackHook() + + 3.0 + + Return an Error instance with a defined stack. + +
    +

    Note: This API has been deprecated in jQuery 3.7; please use the jQuery.Deferred.getErrorHook method instead.

    +
    +
    +

    Note: This API is not defined by default, but jQuery will make use of it when defined.

    +
    +

    See jQuery.Deferred.getErrorHook for the context why this API was created. Initially, we advised users to assign to it a function returning an error stack:

    +
    
    +jQuery.Deferred.getStackHook = function() {
    +  try {
    +    throw new Error( "Exception in jQuery.Deferred" );
    +  } catch ( err ) {
    +    return err.stack; // stack property returned here
    +  }
    +};
    +    
    +

    However, when such a stack is then logged by jQuery from inside of jQuery.Deferred.exceptionHook, the browser won't apply source maps. Therefore, we changed the recommendation to return the full error object itself. To make it clearer, the API was also renamed.

    +
    + + + +
    diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 393bc83c2..9074388b9 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -15,7 +15,7 @@ 1.0 A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). - + A set of key/value pairs that map a given dataType to its MIME type, which gets sent in the Accept request header. This header tells the server what kind of response it will accept in return. For example, the following defines a custom type mycustomtype to be sent with the request:
    
     $.ajax({
    @@ -84,7 +84,12 @@ $.ajax({
             
             
             
    -        Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below).
    +        
    +            

    Data to be sent to the server. If the HTTP method is one that cannot have an entity body, such as GET, the data is appended to the URL.

    +

    When data is an object, jQuery generates the data string from the object's key/value pairs unless the processData option is set to false. For example, { a: "bc", d: "e,f" } is converted to the string "a=bc&d=e%2Cf". If the value is an array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). For example, { a: [1,2] } becomes the string "a%5B%5D=1&a%5B%5D=2" with the default traditional: false setting.

    +

    When data is passed as a string it should already be encoded using the correct encoding for contentType, which by default is application/x-www-form-urlencoded.

    +

    In requests with dataType: "json" or dataType: "jsonp", if the string contains a double question mark (??) anywhere in the URL or a single question mark (?) in the query string, it is replaced with a value generated by jQuery that is unique for each copy of the library on the page (e.g. jQuery21406515378922229067_1479880736745).

    +
    @@ -97,9 +102,9 @@ $.ajax({
    • "xml": Returns a XML document that can be processed via jQuery.
    • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
    • -
    • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
    • -
    • "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests are converted to "jsonp" unless the request includes jsonp: false in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
    • -
    • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
    • +
    • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests. Prior to jQuery 3.5.0, unsuccessful HTTP responses with a script Content-Type were still executed.
    • +
    • "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests that have a callback placeholder, e.g. ?callback=?, are performed using JSONP unless the request includes jsonp: false in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
    • +
    • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
    • "text": A plain text string.
    • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml". Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml.
    @@ -109,7 +114,7 @@ $.ajax({ - A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. + A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." (in HTTP/2 it may instead be an empty string) As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain scripts and cross-domain JSONP requests. This is an Ajax Event.
    Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. @@ -133,7 +138,7 @@ $.ajax({ Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. - + The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). @@ -145,8 +150,11 @@ $.ajax({ By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. + + Defines an object with additional attributes to be used in a "script" or "jsonp" request. The key represents the name of the attribute and the value is the attribute's value. If this object is provided it will force the use of a script-tag transport. For example, this can be used to set nonce, integrity, or crossorigin attributes to satisfy Content Security Policy requirements. + - Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. + Only applies when the "script" transport is used. Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. Alternatively, the charset attribute can be specified in scriptAttrs instead, which will also ensure the use of the "script" transport. @@ -217,7 +225,7 @@ $.ajax();

    As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header:

    
     $.ajax({
    -  url: "http://fiddle.jshell.net/favicon.png",
    +  url: "https://fiddle.jshell.net/favicon.png",
       beforeSend: function( xhr ) {
         xhr.overrideMimeType( "text/plain; charset=x-user-defined" );
       }
    @@ -287,7 +295,7 @@ jqxhr.always(function() {
             status
           
           
  • - statusText + statusText (may be an empty string in HTTP/2)
  • abort( [ statusText ] ) @@ -326,16 +334,16 @@ jqxhr.always(function() {

    Different types of response to $.ajax() call are subjected to different kinds of pre-processing before being passed to the success handler. The type of pre-processing depends by default upon the Content-Type of the response, but can be set explicitly using the dataType option. If the dataType option is provided, the Content-Type header of the response will be disregarded.

    The available data types are text, html, xml, json, jsonp, and script.

    If text or html is specified, no pre-processing occurs. The data is simply passed on to the success handler, and made available through the responseText property of the jqXHR object.

    -

    If xml is specified, the response is parsed using jQuery.parseXML before being passed, as an XMLDocument, to the success handler. The XML document is made available through the responseXML property of the jqXHR object.

    +

    If xml is specified, the response is parsed using jQuery.parseXML before being passed, as an XMLDocument, to the success handler. The XML document is made available through the responseXML property of the jqXHR object.

    If json is specified, the response is parsed using jQuery.parseJSON before being passed, as an object, to the success handler. The parsed JSON object is made available through the responseJSON property of the jqXHR object.

    If script is specified, $.ajax() will execute the JavaScript that is received from the server before passing it on to the success handler as a string.

    If jsonp is specified, $.ajax() will automatically append a query string parameter of (by default) callback=? to the URL. The jsonp and jsonpCallback properties of the settings passed to $.ajax() can be used to specify, respectively, the name of the query string parameter and the name of the JSONP callback function. The server should return valid JavaScript that passes the JSON response into the callback function. $.ajax() will execute the returned JavaScript, calling the JSONP callback function, before passing the JSON object contained in the response to the $.ajax() success handler.

    -

    For more information on JSONP, see the original post detailing its use.

    +

    For more information on JSONP, see the original post detailing its use.

    Sending Data to the Server

    By default, Ajax requests are sent using the GET HTTP method. If the POST method is required, the method can be specified by setting a value for the type option. This option affects how the contents of the data option are sent to the server. POST data will always be transmitted to the server using UTF-8 charset, per the W3C XMLHTTPRequest standard.

    The data option can contain either a query string of the form key1=value1&key2=value2, or an object of the form {key1: 'value1', key2: 'value2'}. If the latter form is used, the data is converted into a query string using jQuery.param() before it is sent. This processing can be circumvented by setting processData to false. The processing might be undesirable if you wish to send an XML object to the server; in this case, change the contentType option from application/x-www-form-urlencoded to a more appropriate MIME type.

    Advanced Options

    -

    The global option prevents handlers registered using .ajaxSend(), .ajaxError(), and similar methods from firing when this request would trigger them. This can be useful to, for example, suppress a loading indicator that was implemented with .ajaxSend() if the requests are frequent and brief. With cross-domain script and JSONP requests, the global option is automatically set to false. See the descriptions of these methods below for more details.

    +

    The global option prevents handlers registered for the ajaxSend, ajaxError, and similar events from firing when this request would trigger them. This can be useful to, for example, suppress a loading indicator that was implemented with an ajaxSend handler if the requests are frequent and brief. With cross-domain script and JSONP requests, the global option is automatically set to false. See the descriptions of these methods below for more details.

    If the server performs HTTP authentication before providing a response, the user name and password pair can be sent via the username and password options.

    Ajax requests are time-limited, so errors can be caught and handled to provide a better user experience. Request timeouts are usually either left at their default or set as a global default using $.ajaxSetup() rather than being overridden for specific requests with the timeout option.

    By default, requests are always issued, but the browser may serve results out of its cache. To disallow use of the cached results, set cache to false. To cause the request to report failure if the asset has not been modified since the last request, set ifModified to true.

    @@ -454,4 +462,6 @@ $.ajax({ + + diff --git a/entries/jQuery.ajaxPrefilter.xml b/entries/jQuery.ajaxPrefilter.xml index f82d8d025..708ca8290 100644 --- a/entries/jQuery.ajaxPrefilter.xml +++ b/entries/jQuery.ajaxPrefilter.xml @@ -40,11 +40,11 @@ $.ajaxPrefilter(function( options, originalOptions, jqXHR ) { } });
  • -

    Prefilters can also be used to modify existing options. For example, the following proxies cross-domain requests through http://mydomain.net/proxy/:

    +

    Prefilters can also be used to modify existing options. For example, the following proxies cross-domain requests through https://mydomain.net/proxy/:

    
     $.ajaxPrefilter(function( options ) {
       if ( options.crossDomain ) {
    -    options.url = "http://mydomain.net/proxy/" + encodeURIComponent( options.url );
    +    options.url = "https://mydomain.net/proxy/" + encodeURIComponent( options.url );
         options.crossDomain = false;
       }
     });
    diff --git a/entries/jQuery.ajaxSetup.xml b/entries/jQuery.ajaxSetup.xml
    index d175c54ac..b0b54447e 100644
    --- a/entries/jQuery.ajaxSetup.xml
    +++ b/entries/jQuery.ajaxSetup.xml
    @@ -26,7 +26,7 @@ $.ajax({
     });
         
    -

    Note: Global callback functions should be set with their respective global Ajax event handler methods—.ajaxStart(), .ajaxStop(), .ajaxComplete(), .ajaxError(), .ajaxSuccess(), .ajaxSend()—rather than within the options object for $.ajaxSetup().

    +

    Note: Global callback functions should be set via .on() with their respective global Ajax events—ajaxStart, ajaxStop, ajaxComplete, ajaxError, ajaxSuccess, ajaxSend—rather than within the options object for $.ajaxSetup().

    diff --git a/entries/jQuery.boxModel.xml b/entries/jQuery.boxModel.xml index f260538ae..b80abe29a 100644 --- a/entries/jQuery.boxModel.xml +++ b/entries/jQuery.boxModel.xml @@ -4,8 +4,12 @@ 1.0 - States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model. This property was removed in jQuery 1.8. Please try to use feature detection instead. - + States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model. + +
    +

    Note: This API has been removed in jQuery 3.0; check if .document.compatMode is equal to "CSS1Compat" instead. Or, even better - always specify a DOCTYPE and avoid using quirks mode which jQuery doesn't support.

    +
    +
    diff --git a/entries/jQuery.browser.xml b/entries/jQuery.browser.xml index e7c690ace..11686eaec 100644 --- a/entries/jQuery.browser.xml +++ b/entries/jQuery.browser.xml @@ -7,6 +7,9 @@ Contains flags for the useragent, read from navigator.userAgent. This property was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin. Please try to use feature detection instead. +
    +

    Note: This API has been removed in jQuery 1.9; please rely on feature detection instead.

    +

    The $.browser property provides information about the web browser that is accessing the page, as reported by the browser itself. It contains flags for each of the four most prevalent browser classes (Internet Explorer, Mozilla, Webkit, and Opera) as well as version information.

    Available flags are:

      @@ -18,7 +21,7 @@

    This property is available immediately. It is therefore safe to use it to determine whether or not to call $(document).ready(). The $.browser property is deprecated in jQuery 1.3, and its functionality may be moved to a team-supported plugin in a future release of jQuery.

    -

    Because $.browser uses navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. Instead of relying on $.browser it's better to use libraries like Modernizr.

    +

    Because $.browser uses navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. Instead of relying on $.browser it's better to use libraries like Modernizr.

    Show the browser info. @@ -56,6 +59,9 @@ $.browser.msie; The version number of the rendering engine for the user's browser. This property was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin. +
    +

    Note: This API has been removed in jQuery 1.9; please rely on feature detection instead.

    +

    Here are some typical results:

    • Internet Explorer: 6.0, 7.0, 8.0
    • diff --git a/entries/jQuery.cssHooks.xml b/entries/jQuery.cssHooks.xml index f7ecb170c..ec36ccfe1 100644 --- a/entries/jQuery.cssHooks.xml +++ b/entries/jQuery.cssHooks.xml @@ -45,7 +45,7 @@ function styleSupport( prop ) { // Capitalize first character of the prop to test vendor prefix capProp = prop.charAt( 0 ).toUpperCase() + prop.slice( 1 ), - prefixes = [ "Moz", "Webkit", "O", "ms" ], + prefixes = [ "Moz", "Webkit", "ms" ], div = document.createElement( "div" ); if ( prop in div.style ) { @@ -89,7 +89,7 @@ if ( !$.cssHooks ) { function styleSupport( prop ) { var vendorProp, supportedProp, capProp = prop.charAt( 0 ).toUpperCase() + prop.slice( 1 ), - prefixes = [ "Moz", "Webkit", "O", "ms" ], + prefixes = [ "Moz", "Webkit", "ms" ], div = document.createElement( "div" ); if ( prop in div.style ) { @@ -163,7 +163,7 @@ if ( $.support.someCSSProp && $.support.someCSSProp !== "someCSSProp" ) })( jQuery );

    Special units

    -

    By default, jQuery adds a "px" unit to the values passed to the .css() method. This behavior can be prevented by adding the property to the jQuery.cssNumber object

    +

    By default, jQuery adds a "px" unit to the values passed to the .css() method. This behavior can be prevented by adding the property to the jQuery.cssNumber object

    
     $.cssNumber.someCSSProp = true;
         
    diff --git a/entries/jQuery.cssNumber.xml b/entries/jQuery.cssNumber.xml index ce5af8867..c49b3c785 100644 --- a/entries/jQuery.cssNumber.xml +++ b/entries/jQuery.cssNumber.xml @@ -1,30 +1,50 @@ - + jQuery.cssNumber 1.4.3 - An object containing all CSS properties that may be used without a unit. The .css() method uses this object to see if it may append px to unitless values. + An object containing all CSS properties that may be used without a unit. Prior to jQuery 4.0, the .css() method uses this object to see if it may append px to unitless values. -

    You can think about jQuery.cssNumber as a list of all CSS properties you might use without a unit. It's used by .css() to determine if it needs to add px to unitless values.

    -

    The keys of the jQuery.cssNumber object are camel-cased and the values are all set to true. If you want to prevent the .css() method from automatically adding the px unit for a specific CSS property, you can add an extra property to the jQuery.cssNumber object.

    +
    +

    Note: This API has been removed in jQuery 4.0; please pass a string value with the desired units instead.

    +
    +

    You can think about jQuery.cssNumber as a list of all CSS properties you might use without a unit. Prior to jQuery 4.0, it was used by .css() to determine if it needs to add px to unitless values.

    +

    The keys of the jQuery.cssNumber object are camel-cased and the values are all set to true. If you want to prevent the .css() method from automatically adding the px unit for a specific CSS property and that property is not yet a key of the jQuery.cssNumber object, you can add such an extra property:

    
    -jQuery.cssNumber.someCSSProp = true;
    +if ( jQuery.cssNumber ) {
    +  jQuery.cssNumber.someCSSProp = true;
    +}
         

    By default the object contains the following properties:

      -
    • zIndex
    • -
    • fontWeight
    • -
    • opacity
    • -
    • zoom
    • -
    • lineHeight
    • -
    • widows (added in jQuery 1.6)
    • -
    • orphans (added in jQuery 1.6)
    • -
    • fillOpacity (added in jQuery 1.6.2)
    • -
    • columnCount (added in jQuery 1.9)
    • -
    • order (added in jQuery 1.10.2)
    • -
    • flexGrow (added in jQuery 1.11.1)
    • -
    • flexShrink (added in jQuery 1.11.1)
    • +
    • animationIterationCount (added in 1.12.0/2.2.0)
    • +
    • aspectRatio (added in 3.7.0)
    • +
    • borderImageSlice (added in 3.7.0)
    • +
    • columnCount (added in 1.9.0)
    • +
    • flexGrow (added in 1.11.1/2.1.1)
    • +
    • flexShrink (added in 1.11.1/2.1.1)
    • +
    • fontWeight (added in 1.4.3)
    • +
    • gridArea (added in 3.4.0)
    • +
    • gridColumn (added in 3.4.0)
    • +
    • gridColumnEnd (added in 3.4.0)
    • +
    • gridColumnStart (added in 3.4.0)
    • +
    • gridRow (added in 3.4.0)
    • +
    • gridRowEnd (added in 3.4.0)
    • +
    • gridRowStart (added in 3.4.0)
    • +
    • lineHeight (added in 1.4.3)
    • +
    • opacity (added in 1.4.3)
    • +
    • order (added in 1.10.2/2.0.3)
    • +
    • orphans (added in 1.6.0)
    • +
    • scale (added in 3.7.0)
    • +
    • widows (added in 1.6.0)
    • +
    • zIndex (added in 1.4.3)
    • +
    • zoom (added in 1.4.3)
    • +
    • fillOpacity (SVG-related, added in 1.6.2)
    • +
    • floodOpacity (SVG-related, added in 3.7.0)
    • +
    • stopOpacity (SVG-related, added in 3.7.0)
    • +
    • strokeMiterlimit (SVG-related, added in 3.7.0)
    • +
    • strokeOpacity (SVG-related, added in 3.7.0)
    diff --git a/entries/jQuery.data.xml b/entries/jQuery.data.xml index bc1bab43f..5207c8b89 100644 --- a/entries/jQuery.data.xml +++ b/entries/jQuery.data.xml @@ -34,8 +34,8 @@ jQuery.data( div, "test", { first: 16, last: "pizza!" }); -$( "span:first" ).text( jQuery.data( div, "test" ).first ); -$( "span:last" ).text( jQuery.data( div, "test" ).last ); +$( "span" ).first().text( jQuery.data( div, "test" ).first ); +$( "span" ).last().text( jQuery.data( div, "test" ).last ); ]]> Takes a string and throws an exception containing it.

    This method exists primarily for plugin developers who wish to override it and provide a better display (or more information) for the error messages.

    +

    If you do override the method, remember to still throw an error at the end to preserve semantics.

    - Override jQuery.error for display in Firebug. + Override jQuery.error to send it to a logging service, assuming the sendErrorLog method is provided by this service. diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml index 42edb4ae4..472626153 100644 --- a/entries/jQuery.extend.xml +++ b/entries/jQuery.extend.xml @@ -4,9 +4,9 @@ 1.0 - An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. + An object that will receive the new properties. - + An object containing additional properties to merge in. @@ -28,6 +28,12 @@ Additional objects containing properties to merge in. + + 1.0 + + An object to merge onto the jQuery namespace. + + Merge the contents of two or more objects together into the first object.

    When two or more object arguments are supplied to $.extend(), properties from all of the objects are added to the target object. Arguments that are null or undefined are ignored.

    @@ -35,10 +41,11 @@

    Keep in mind that the target object (first argument) will be modified, and will also be returned from $.extend(). If, however, you want to preserve both of the original objects, you can do so by passing an empty object as the target:

    var object = $.extend({}, object1, object2);

    The merge performed by $.extend() is not recursive by default; if a property of the first object is itself an object or array, it will be completely overwritten by a property with the same key in the second or subsequent object. The values are not merged. This can be seen in the example below by examining the value of banana. However, by passing true for the first function argument, objects will be recursively merged.

    +

    Warning: Versions prior to 3.4 had a security issue where calling jQuery.extend(true, {}, object) on an unsanitized object containing a __proto__ property would extend Object.prototype.

    Warning: Passing false for the first argument is not supported.

    Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. Properties that are an object constructed via new MyCustomObject(args), or built-in JavaScript types such as Date or RegExp, are not re-constructed and will appear as plain Objects in the resulting object or array.

    On a deep extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not. Deep-extending a cyclical data structure will result in an error.

    -

    For needs that fall outside of this behavior, write a custom extend method instead, or use a library like lodash.

    +

    For needs that fall outside of this behavior, write a custom extend method instead, or use a library like lodash.

    Merge two objects, modifying the first. @@ -106,4 +113,5 @@ $( "#log" ).append( "
    settings -- " + JSON.stringify( settings ) + "< + diff --git a/entries/jQuery.fx.interval.xml b/entries/jQuery.fx.interval.xml index 5516d75c8..b86516c3e 100644 --- a/entries/jQuery.fx.interval.xml +++ b/entries/jQuery.fx.interval.xml @@ -1,12 +1,14 @@ - + jQuery.fx.interval The rate (in milliseconds) at which animations fire. 1.4.3 -

    This property is deprecated as of version 3.0, and has no effect in browsers that support the requestAnimationFrame method.

    +
    +

    This property is deprecated as of version 3.0, and has no effect in browsers that support the requestAnimationFrame method.

    +

    On browsers that do not support requestAnimationFrame, this property can be changed to adjust the interval at which animations will run. The default is 13 milliseconds.

    Since jQuery uses one global interval, no animation should be running or all animations should stop for the change of this property to take effect.

    @@ -14,7 +16,7 @@ Cause all animations to run with less frames. diff --git a/entries/jQuery.fx.off.xml b/entries/jQuery.fx.off.xml index 74bfd60a3..8464f69f5 100644 --- a/entries/jQuery.fx.off.xml +++ b/entries/jQuery.fx.off.xml @@ -20,10 +20,10 @@ var toggleFx = function() { $.fx.off = !$.fx.off; }; toggleFx(); -$( "button" ).click( toggleFx ); -$( "input" ).click(function() { +$( "button" ).on( "click", toggleFx ); +$( "input" ).on( "click", function() { $( "div" ).toggle( "slow" ); -}); +} ); ]]> - Get the test.php page contents, which has been returned in json format (<?php echo json_encode( array( "name"=>"John","time"=>"2pm" ) ); ?>), and add it to the page. + Get the test.php page contents, which has been returned in json format (<?php echo json_encode( array( "name"=>"John","time"=>"2pm" ) ); ?>), and add it to the page. + + + Get another page on the same domain. Outputs to console both the data returned and the type of data returned. + +
    diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml index c3b1e1e26..1449293d2 100644 --- a/entries/jQuery.getJSON.xml +++ b/entries/jQuery.getJSON.xml @@ -56,7 +56,7 @@ $.getJSON( "ajax/test.json", function( data ) {

    The success callback is passed the returned data, which is typically a JavaScript object or array as defined by the JSON structure and parsed using the $.parseJSON() method. It is also passed the text status of the response.

    As of jQuery 1.5, the success callback function receives a "jqXHR" object (in jQuery 1.4, it received the XMLHttpRequest object). However, since JSONP and cross-domain GET requests do not use XHR, in those cases the jqXHR and textStatus parameters passed to the success callback are undefined.

    -

    Important: As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently. Avoid frequent hand-editing of JSON data for this reason. JSON is a data-interchange format with syntax rules that are stricter than those of JavaScript's object literal notation. For example, all strings represented in JSON, whether they are properties or values, must be enclosed in double-quotes. For details on the JSON format, see http://json.org/.

    +

    Important: As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently. Avoid frequent hand-editing of JSON data for this reason. JSON is a data-interchange format with syntax rules that are stricter than those of JavaScript's object literal notation. For example, all strings represented in JSON, whether they are properties or values, must be enclosed in double-quotes. For details on the JSON format, see https://json.org/.

    JSONP

    If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

    @@ -82,7 +82,7 @@ var jqxhr = $.getJSON( "example.json", function() { // Perform other work here ... // Set another completion function for the request above -jqxhr.complete(function() { +jqxhr.always(function() { console.log( "second complete" ); }); @@ -95,7 +95,7 @@ jqxhr.complete(function() { Loads the four most recent pictures of Mount Rainier from the Flickr JSONP API. + + + Execute a script with a nonce value on a site with Content Security Policy enabled. + +

    The $.holdReady() method allows the caller to delay jQuery's ready event. This advanced feature would typically be used by dynamic script loaders that want to load additional JavaScript such as jQuery plugins before allowing the ready event to occur, even though the DOM may be ready. This method must be called early in the document, such as in the <head> immediately after the jQuery script tag. Calling this method after the ready event has already fired will have no effect.

    To delay the ready event, first call $.holdReady( true ). When the ready event should be released to execute, call $.holdReady( false ). Note that multiple holds can be put on the ready event, one for each $.holdReady( true ) call. The ready event will not actually fire until all holds have been released with a corresponding number of $.holdReady( false ) calls and the normal document ready conditions are met. (See ready for more information.)

    @@ -25,4 +35,5 @@ $.getScript( "myplugin.js", function() { +
    diff --git a/entries/jQuery.htmlPrefilter.xml b/entries/jQuery.htmlPrefilter.xml index 3682ed5bd..753819039 100644 --- a/entries/jQuery.htmlPrefilter.xml +++ b/entries/jQuery.htmlPrefilter.xml @@ -3,75 +3,15 @@ jQuery.htmlPrefilter() Modify and filter HTML strings passed through jQuery manipulation methods. - 1.12/2.2 + 1.12-and-2.2 The HTML string on which to operate. -

    This method rarely needs to be called directly. Instead, use it as an entry point to modify existing jQuery manipulation methods. For instance, to remove all <del> tags from incoming HTML strings, do this:

    -
    
    -var htmlPrefilter = $.htmlPrefilter,
    -  rdel = /<(del)(?=[\s>])[\w\W]*?<\/\1\s*>/gi;
    -
    -$.htmlPrefilter = function( html ) {
    -  return htmlPrefilter.call( this, html ).replace( rdel, "" );
    -};
    -    
    -

    This function can also be overwritten in order to bypass certain edge case issues. The default htmlPrefilter function in jQuery will greedily ensure that all tags are XHTML-compliant. This includes anything that looks like an HTML tag, but is actually within a string (e.g.

    <a title="<div />"><>
    ). The jQuery.htmlPrefilter() function can be used to bypass this:

    -
    
    -$.htmlPrefilter = function( html ) {
    -  // Return HTML strings unchanged
    -  return html;
    -};
    -    
    -

    However, while the above fix is short and simple, it puts the burden on you to ensure XHTML-compliant tags in any HTML strings. A more thorough fix for this issue would be this:

    -
    
    -var panything = "[\\w\\W]*?",
    -
    -  // Whitespace
    -  // https://html.spec.whatwg.org/multipage/infrastructure.html#space-character
    -  pspace = "[\\x20\\t\\r\\n\\f]",
    -
    -  // End of tag name (whitespace or greater-than)
    -  pnameEnd = pspace.replace( "]", ">]" ),
    -
    -  // Tag name (a leading letter, then almost anything)
    -  // https://html.spec.whatwg.org/multipage/syntax.html#tag-open-state
    -  // https://html.spec.whatwg.org/multipage/syntax.html#tag-name-state
    -  pname = "[a-z]" + pnameEnd.replace( "[", "[^/\\0" ) + "*",
    -
    -  // Void element (end tag prohibited)
    -  // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
    -  pvoidName = "(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|" +
    -    "source|track|wbr)(?=" + pnameEnd + ")",
    -
    -  // Attributes (double-quoted value, single-quoted value, unquoted value, or no value)
    -  // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
    -  pattrs = "(?:" + pspace + "+[^\\0-\\x20\\x7f-\\x9f=\"'/>]+(?:" + pspace + "*=" + pspace +
    -    "*(?:\"" + panything + "\"|'" + panything + "'|" +
    -    pnameEnd.replace( "[", "[^" ) + "*(?!/)" +
    -    ")|))*" + pspace + "*",
    -
    -  // Trailing content of a close tag
    -  pcloseTail = "(?:" + pspace + panything + "|)",
    -
    -  rspecialHtml = new RegExp(
    -    // Non-void element that self-closes: $1–$5
    -    "(<)(?!" + pvoidName + ")(" + pname + ")(" + pattrs + ")(\\/)(>)|" +
    -      // No-innerHTML container (element, comment, or CDATA): $6
    -      "(<(script|style|textarea)" + pattrs + ">" + panything + "<\\/\\7" + pcloseTail + ">|" +
    -      "<!--" + panything + "--)",
    -    "gi"
    -  ),
    -
    -  // "<"; element name; attributes; ">"; "<"; "/"; element name; ">"; no-innerHTML container
    -  pspecialReplacement = "$1$2$3$5$1$4$2$5$6";
    -
    -$.htmlPrefilter = function( html ) {
    -  return ( html + "" ).replace( rspecialHtml, pspecialReplacement );
    -};
    -    
    +

    This method rarely needs to be called directly. Instead, use it as an entry point to modify existing jQuery manipulation methods. jQuery calls this method on input HTML before processing it further: it accepts an HTML string & should return a HTML string as well.

    +

    This function can also be overwritten in order to bypass certain edge case issues. The default htmlPrefilter function in jQuery leaves input unmodified since 3.5.0. Older versions would greedily ensure that all tags were XHTML-compliant. This included anything that looked like an HTML tag, but was actually within a string (e.g. <a title="<div />"><>), leading to potential security issues. For more information, see the jQuery Core 3.5 Upgrade guide.

    +
    diff --git a/entries/jQuery.isArray.xml b/entries/jQuery.isArray.xml index 6f040c4ec..9891126ff 100644 --- a/entries/jQuery.isArray.xml +++ b/entries/jQuery.isArray.xml @@ -1,5 +1,5 @@ - + jQuery.isArray() 1.3 @@ -9,6 +9,9 @@ Determine whether the argument is an array. +
    +

    Note: This API has been deprecated in jQuery 3.2; please use the native Array.isArray method instead.

    +

    $.isArray() returns a Boolean indicating whether the object is a JavaScript array (not an array-like object, such as a jQuery object).

    @@ -22,4 +25,5 @@ Is [] an Array? +
    diff --git a/entries/jQuery.isFunction.xml b/entries/jQuery.isFunction.xml index 689cdbf73..5160f0a70 100644 --- a/entries/jQuery.isFunction.xml +++ b/entries/jQuery.isFunction.xml @@ -1,14 +1,17 @@ - + jQuery.isFunction() 1.2 - - Object to test whether or not it is a function. + + The value to be tested. - Determine if the argument passed is a JavaScript function object. + Determines if its argument is callable as a function. +
    +

    As of jQuery 3.3, jQuery.isFunction() has been deprecated. In most cases, its use can be replaced by typeof x === "function".

    +

    Note: As of jQuery 1.3, functions provided by the browser like alert() and DOM element methods like getAttribute() are not guaranteed to be detected as functions in browsers such as Internet Explorer.

    @@ -57,4 +60,5 @@ true +
    diff --git a/entries/jQuery.isNumeric.xml b/entries/jQuery.isNumeric.xml index b51eb84d3..c4fe4a72d 100644 --- a/entries/jQuery.isNumeric.xml +++ b/entries/jQuery.isNumeric.xml @@ -1,5 +1,5 @@ - + jQuery.isNumeric() Determines whether its argument represents a JavaScript number. @@ -9,6 +9,9 @@ +
    +

    Note: This API has been deprecated in jQuery 3.3.

    +

    The $.isNumeric() method checks whether its argument represents a numeric value. If so, it returns true. Otherwise it returns false. The argument can be of any type.

    As of jQuery 3.0 $.isNumeric() returns true only if the argument is of type number, or if it's of type string and it can be coerced into finite numbers. In all other cases, it returns false.

    @@ -39,4 +42,5 @@ $.isNumeric( undefined ) +
    diff --git a/entries/jQuery.isWindow.xml b/entries/jQuery.isWindow.xml index 154535995..76a58f176 100644 --- a/entries/jQuery.isWindow.xml +++ b/entries/jQuery.isWindow.xml @@ -1,5 +1,5 @@ - + jQuery.isWindow() 1.4.3 @@ -9,6 +9,12 @@ Determine whether the argument is a window. +
    +

    Note: This API has been deprecated in jQuery 3.3; if you need this function, reimplement it by yourself:

    + +

    This is used in a number of places in jQuery to determine if we're operating against a browser window (such as the current window or an iframe).

    @@ -22,4 +28,5 @@ Is 'window' a window? +
    diff --git a/entries/jQuery.map.xml b/entries/jQuery.map.xml index 3c499e6c8..2016df876 100644 --- a/entries/jQuery.map.xml +++ b/entries/jQuery.map.xml @@ -3,8 +3,8 @@ jQuery.map() 1.0 - - The Array to translate. + + The Array or an Array-like object to translate. @@ -16,7 +16,7 @@ 1.6 - The Object to translate. + The non-Array-like Object to translate. @@ -28,16 +28,13 @@ Translate all items in an array or object to new array of items.

    If you wish to process a jQuery object — for example, $('div').map( callback ); — use .map() instead.

    -

    The $.map() method applies a function to each item in an array or object and maps the results into a new array. Prior to jQuery 1.6, $.map() supports traversing arrays only. As of jQuery 1.6 it also traverses objects.

    -

    Array-like objects — those with a .length property and a value on the .length - 1 index — must be converted to actual arrays before being passed to $.map(). The jQuery library provides $.makeArray() for such conversions.

    +

    The $.map() method applies a function to each item in an array or object and maps the results into a new array. Prior to jQuery 1.6, $.map() supports traversing arrays and array-like objects only. As of jQuery 1.6 it also traverses objects.

    +

    Array-like objects — those with a .length property and a value on the .length - 1 index — may be passed to $.map().

    
    -// The following object masquerades as an array.
    +// The following object is array-like.
     var fakeArray = { "length": 2, 0: "Addy", 1: "Subtracty" };
     
    -// Therefore, convert it to a real array
    -var realArray = $.makeArray( fakeArray )
    -
    -// Now it can be used reliably with $.map()
    +// It can be used reliably with $.map()
     $.map( realArray, function( val, i ) {
       // Do something
     });
    diff --git a/entries/jQuery.now.xml b/entries/jQuery.now.xml
    index 6c41af36c..00992aba8 100644
    --- a/entries/jQuery.now.xml
    +++ b/entries/jQuery.now.xml
    @@ -1,13 +1,17 @@
     
    -
    +
       jQuery.now()
       
         1.4.3
       
       Return a number representing the current time.
       
    -    

    The $.now() method is a shorthand for the number returned by the expression (new Date).getTime().

    +
    +

    Note: This API has been deprecated in jQuery 3.3; please use the native Date.now() method instead.

    +
    +

    The $.now() method is an alias for Date.now().

    -
    \ No newline at end of file + +
    diff --git a/entries/jQuery.parseHTML.xml b/entries/jQuery.parseHTML.xml index 5354627ae..5ff74ce77 100644 --- a/entries/jQuery.parseHTML.xml +++ b/entries/jQuery.parseHTML.xml @@ -18,8 +18,8 @@

    jQuery.parseHTML uses native methods to convert the string to a set of DOM nodes, which can then be inserted into the document. These methods do render all trailing or leading text (even if that's just whitespace). To prevent trailing/leading whitespace from being converted to text nodes you can pass the HTML string through jQuery.trim.

    By default, the context is the current document if not specified or given as null or undefined. If the HTML was to be used in another document such as an iframe, that frame's document could be used.

    As of 3.0 the default behavior is changed. If the context is not specified or given as null or undefined, a new document is used. This can potentially improve security because inline events will not execute when the HTML is parsed. Once the parsed HTML is injected into a document it does execute, but this gives tools a chance to traverse the created DOM and remove anything deemed unsafe. This improvement does not apply to internal uses of jQuery.parseHTML as they usually pass in the current document. Therefore, a statement like $( "#log" ).append( $( htmlString ) ) is still subject to the injection of malicious code.

    -

    Security Considerations

    -

    Most jQuery APIs that accept HTML strings will run scripts that are included in the HTML. jQuery.parseHTML does not run scripts in the parsed HTML unless keepScripts is explicitly true. However, it is still possible in most environments to execute scripts indirectly, for example via the <img onerror> attribute. The caller should be aware of this and guard against it by cleaning or escaping any untrusted inputs from sources such as the URL or cookies. For future compatibility, callers should not depend on the ability to run any script content when keepScripts is unspecified or false.

    +

    Security Considerations

    +

    Most jQuery APIs that accept HTML strings will run scripts that are included in the HTML. jQuery.parseHTML does not run scripts in the parsed HTML unless keepScripts is explicitly true. However, it is still possible in most environments to execute scripts indirectly, for example via the <img onerror> attribute. The caller should be aware of this and guard against it by cleaning or escaping any untrusted inputs from sources such as the URL or cookies. For future compatibility, callers should not depend on the ability to run any script content when keepScripts is unspecified or false.

    Create an array of DOM nodes using an HTML string and insert it into a div. diff --git a/entries/jQuery.parseJSON.xml b/entries/jQuery.parseJSON.xml index 054663df8..2023ebc83 100644 --- a/entries/jQuery.parseJSON.xml +++ b/entries/jQuery.parseJSON.xml @@ -1,5 +1,5 @@ - + @@ -14,7 +14,9 @@ Takes a well-formed JSON string and returns the resulting JavaScript value. -

    As of jQuery 3.0, $.parseJSON is deprecated. To parse JSON strings use the native JSON.parse method instead.

    +
    +

    As of jQuery 3.0, $.parseJSON is deprecated. To parse JSON strings use the native JSON.parse method instead.

    +

    Passing in a malformed JSON string results in a JavaScript exception being thrown. For example, the following are all invalid JSON strings:

    • "{test: 1}" (test does not have double quotes around it).
    • @@ -25,7 +27,7 @@
    • "NaN" (NaN cannot be represented in a JSON string; direct representation of Infinity is also not permitted).

    The JSON standard does not permit "control characters" such as a tab or newline. An example like $.parseJSON( '{ "testing":"1\t2\n3" }' ) will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like "1\\t2\\n3" yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.

    -

    Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

    +

    Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see https://json.org/.

    Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an error if it was passed an empty string, null, or undefined, even though those are not valid JSON.

    @@ -37,4 +39,5 @@ alert( obj.name === "John" ); +
    diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index 6152350a0..e862071fa 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -15,19 +15,19 @@ - A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. + A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null or jQuery.noop as a placeholder. NOTE: In jQuery 3.x and older, when providing a null value for success you also have to provide the data parameter; you can set it to undefined. The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - 1.12/2.2 + 1.12-and-2.2 - A set of key/value pairs that configure the Ajax request. All properties except for url are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a complete list of all settings. Type will automatically be set to POST. + A set of key/value pairs that configure the Ajax request. All properties except for url are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a complete list of all settings. Type will automatically be set to POST. - Load data from the server using a HTTP POST request. + Send data to the server using a HTTP POST request.

    This is a shorthand Ajax function, which is equivalent to:

    
    @@ -50,7 +50,7 @@ $.post( "ajax/test.html", function( data ) {
         

    This example fetches the requested HTML snippet and inserts it on the page.

    Pages fetched with POST are never cached, so the cache and ifModified options in jQuery.ajaxSetup() have no effect on these requests.

    The jqXHR Object

    -

    As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error; added in jQuery 1.6) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

    +

    As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.post() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error; added in jQuery 1.6) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

    The Promise interface also allows jQuery's Ajax methods, including $.get(), to chain multiple .done(), .fail(), and .always() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

    
     // Assign handlers immediately after making the request,
    @@ -135,7 +135,7 @@ $.post( "test.php", { func: "getNameAndTime" }, function( data ) {
         Post a form using Ajax and put results in a div
         
         
         
       
    -  
    +  
         
           1.3
           
    @@ -105,21 +105,21 @@ runIt();
         
           Queue a custom function.
           
           
    -
    +
       jQuery.removeData()
       
         1.2.3
    @@ -19,13 +19,13 @@
         Set a data store for 2 names then remove one of them.
         
         
       
    +    
    +

    Note: This API has been deprecated in jQuery 3.3.

    +

    A number of techniques are used to determine the exact return value for an object. The [[Class]] is determined as follows:

    • If the object is undefined or null, then "undefined" or "null" is returned accordingly. @@ -24,16 +27,16 @@
    • jQuery.type( true ) === "boolean"
    • jQuery.type( new Boolean() ) === "boolean"
    • jQuery.type( 3 ) === "number"
    • -
    • jQuery.type( new Number(3) ) === "number"
    • +
    • jQuery.type( new Number( 3 ) ) === "number"
    • jQuery.type( "test" ) === "string"
    • -
    • jQuery.type( new String("test") ) === "string"
    • -
    • jQuery.type( function(){} ) === "function"
    • +
    • jQuery.type( new String( "test" ) ) === "string"
    • +
    • jQuery.type( function() {} ) === "function"
    • jQuery.type( [] ) === "array"
    • jQuery.type( new Array() ) === "array"
    • jQuery.type( new Date() ) === "date"
    • jQuery.type( new Error() ) === "error" // as of jQuery 1.9
    • jQuery.type( Symbol() ) === "symbol" // as of jQuery 1.9
    • -
    • jQuery.type( Object(Symbol()) ) === "symbol" // as of jQuery 1.12
    • +
    • jQuery.type( Object( Symbol() ) ) === "symbol" // as of jQuery 1.12
    • jQuery.type( /test/ ) === "regexp"
    @@ -51,4 +54,5 @@ Is it a RegExp?
    +
    diff --git a/entries/jQuery.unique.xml b/entries/jQuery.unique.xml index b31ce023c..bac613345 100644 --- a/entries/jQuery.unique.xml +++ b/entries/jQuery.unique.xml @@ -9,7 +9,9 @@ Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. -

    As of jQuery 3.0, this method is deprecated and just an alias of jQuery.uniqueSort(). Please use that method instead.

    +
    +

    As of jQuery 3.0, this method is deprecated and just an alias of jQuery.uniqueSort(). Please use that method instead.

    +

    The $.unique() function searches through an array of objects, sorting the array, and removing any duplicate nodes. A node is considered a duplicate if it is the exact same node as one already in the array; two different nodes with identical attributes are not considered to be duplicates. This function only works on plain JavaScript arrays of DOM elements, and is chiefly used internally by jQuery. You probably will never need to use it.

    As of jQuery 1.4 the results will always be returned in document order.

    @@ -21,10 +23,10 @@ var divs = $( "div" ).get(); // Add 3 elements of class dup too (they are divs) divs = divs.concat( $( ".dup" ).get() ); -$( "div:eq(1)" ).text( "Pre-unique there are " + divs.length + " elements." ); +$( "div" ).eq( 1 ).text( "Pre-unique there are " + divs.length + " elements." ); divs = jQuery.unique( divs ); -$( "div:eq(2)" ).text( "Post-unique there are " + divs.length + " elements." ) +$( "div" ).eq( 2 ).text( "Post-unique there are " + divs.length + " elements." ) .css( "color", "red" ); ]]>
    - + diff --git a/entries/jQuery.xml b/entries/jQuery.xml index 80e5bf194..8df77906f 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -11,7 +11,8 @@ - A DOM Element, Document, or jQuery to use as context + + A DOM Element, Document, jQuery or selector to use as context @@ -49,7 +50,7 @@

    Selector Context

    By default, selectors perform their searches within the DOM starting at the document root. However, an alternate context can be given for the search by using the optional second parameter to the $() function. For example, to do a search within an event handler, the search can be restricted like so:

    
    -$( "div.foo" ).click(function() {
    +$( "div.foo" ).on( "click", function() {
       $( "span", this ).addClass( "bar" );
     });
           
    @@ -61,7 +62,7 @@ $( "div.foo" ).click(function() {

    Please note that although you can pass text nodes and comment nodes into a jQuery collection this way, most operations don't support them. The few that do will have an explicit note on their API documentation page.

    A common use of single-DOM-element construction is to call jQuery methods on an element that has been passed to a callback function through the keyword this:

    
    -$( "div.foo" ).click(function() {
    +$( "div.foo" ).on( "click", function() {
       $( this ).slideUp();
     });
           
    @@ -77,7 +78,7 @@ $.post( "url.xml", function( data ) {

    When a jQuery object is passed to the $() function, a clone of the object is created. This new jQuery object references the same DOM elements as the initial one.

    Returning an Empty Set

    -

    As of jQuery 1.4, calling the jQuery() method with no arguments returns an empty jQuery set (with a .length property of 0). In previous versions of jQuery, this would return a set containing the document node.

    +

    Calling the jQuery() method with no arguments returns an empty jQuery set (with a .length property of 0). Similarly, if an argument of null, undefined, an empty array ([]), or an empty string ("") is passed, the set contains no elements.

    Working With Plain Objects

    At present, the only operations supported on plain JavaScript objects wrapped in jQuery are: .data(),.prop(),.on(), .off(), .trigger() and .triggerHandler(). The use of .data() (or any method requiring .data()) on a plain object will result in a new property on the object called jQuery{randomNumber} (eg. jQuery123456789).

    
    @@ -155,7 +156,7 @@ $( myForm.elements ).hide();
           
             A string of HTML to create on the fly. Note that this parses HTML, not XML.
           
    -      
    +      
             A document in which the new elements will be created.
           
         
    @@ -177,12 +178,12 @@ $( myForm.elements ).hide();
           

    By default, elements are created with an .ownerDocument matching the document into which the jQuery library was loaded. Elements being injected into a different document should be created using that document, e.g., $("<p>hello iframe</p>", $("#myiframe").prop("contentWindow").document).

    If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's .innerHTML mechanism. In most cases, jQuery creates a new <div> element and sets the innerHTML property of the element to the HTML snippet that was passed in. When the parameter has a single tag (with optional closing tag or quick-closing) — $( "<img />" ) or $( "<img>" ), $( "<a></a>" ) or $( "<a>" ) — jQuery creates the element using the native JavaScript .createElement() function.

    When passing in complex HTML, some browsers may not generate a DOM that exactly replicates the HTML source provided. As mentioned, jQuery uses the browser's .innerHTML property to parse the passed HTML and insert it into the current document. During this process, some browsers filter out certain elements such as <html>, <title>, or <head> elements. As a result, the elements inserted may not be representative of the original string passed.

    -

    Filtering isn't, however, limited to these tags. For example, Internet Explorer prior to version 8 will also convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

    +

    Filtering isn't, however, limited to these tags. For example, Internet Explorer prior to version 8 will also convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

    To ensure cross-platform compatibility, the snippet must be well-formed. Tags that can contain other elements should be paired with a closing tag:

    -
    $( "<a href='http://jquery.com'></a>" );
    +
    $( "<a href='https://jquery.com'></a>" );

    Tags that cannot contain elements may be quick-closed or not:

    
    -$( "<img>" );
    +$( "<img />" );
     $( "<input>" );
           

    When passing HTML to jQuery(), note that text nodes are not treated as DOM elements. With the exception of a few methods (such as .content()), they are generally ignored or removed. E.g:

    diff --git a/entries/keydown-shorthand.xml b/entries/keydown-shorthand.xml new file mode 100644 index 000000000..98b125b34 --- /dev/null +++ b/entries/keydown-shorthand.xml @@ -0,0 +1,36 @@ + + + .keydown() + Bind an event handler to the "keydown" event, or trigger that event on an element. + + 1.0 + + A function to execute each time the event is triggered. + + + + + 1.4.3 + + An object containing data that will be passed to the event handler. + + + A function to execute each time the event is triggered. + + + + + 1.0 + + +
    +

    This API is deprecated.

    +

    Instead of .keydown( handler ) or .keydown( eventData, handler ), use .on( "keydown", handler ) or .on( "keydown", eventData, handler ), respectively.

    +

    Instead of .keydown(), use .trigger( "keydown" ).

    +
    +
    + + + + +
    diff --git a/entries/keydown.xml b/entries/keydown.xml index f21ae4e0f..576a1ad0c 100644 --- a/entries/keydown.xml +++ b/entries/keydown.xml @@ -1,15 +1,15 @@ - - .keydown() + +Bind an event handler to the "keydown" event, or trigger that event on an element. + + + keydown event + Bind an event handler to the "keydown" event. - 1.0 - - A function to execute each time the event is triggered. - + 1.7 + + The string "keydown". - - - 1.4.3 An object containing data that will be passed to the event handler. @@ -18,12 +18,10 @@ - - 1.0 - - Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. -

    This method is a shortcut for .on( "keydown", handler ) in the first and second variations, and .trigger( "keydown" ) in the third.

    +
    +

    This page describes the keydown event. For the deprecated .keydown() method, see .keydown().

    +

    The keydown event is sent to an element when the user presses a key on the keyboard. If the key is kept pressed, the event is sent every time the operating system repeats the key. It can be attached to any element, but the event is only sent to the element that has the focus. Focusable elements can vary between browsers, but form elements can always get focus so are reasonable candidates for this event type.

    For example, consider the HTML:

    
    @@ -36,42 +34,41 @@
         

    The event handler can be bound to the input field:

    
    -$( "#target" ).keydown(function() {
    -  alert( "Handler for .keydown() called." );
    -});
    +$( "#target" ).on( "keydown", function() {
    +  alert( "Handler for `keydown` called." );
    +} );
         

    Now when the insertion point is inside the field, pressing a key displays the alert:

    - Handler for .keydown() called. + Handler for `keydown` called.

    -

    To trigger the event manually, apply .keydown() without an argument:

    +

    To trigger the event manually, use .trigger( "keydown" ):

    
    -$( "#other" ).click(function() {
    -  $( "#target" ).keydown();
    -});
    +$( "#other" ).on( "click", function() {
    +  $( "#target" ).trigger( "keydown" );
    +} );
         

    After this code executes, clicks on Trigger the handler will also alert the message.

    If key presses anywhere need to be caught (for example, to implement global shortcut keys on a page), it is useful to attach this behavior to the document object. Because of event bubbling, all key presses will make their way up the DOM to the document object unless explicitly stopped.

    To determine which key was pressed, examine the event object that is passed to the handler function. While browsers use differing properties to store this information, jQuery normalizes the .which property so you can reliably use it to retrieve the key code. This code corresponds to a key on the keyboard, including codes for special keys such as arrows. For catching actual text entry, .keypress() may be a better choice.

    - Show the event object for the keydown handler when a key is pressed in the input.
    diff --git a/entries/length.xml b/entries/length.xml index 105f23d84..37a2d54cf 100644 --- a/entries/length.xml +++ b/entries/length.xml @@ -12,12 +12,12 @@ Count the divs. Click to add more. diff --git a/entries/live.xml b/entries/live.xml index 049322e27..0943af956 100644 --- a/entries/live.xml +++ b/entries/live.xml @@ -32,7 +32,9 @@ -

    As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().

    +
    +

    Note: This API has been removed in jQuery 1.9; please use on() instead.

    +

    This method provides a means to attach delegated event handlers to the document element of a page, which simplifies the use of event handlers when content is dynamically added to a page. See the discussion of direct versus delegated events in the .on() method for more information.

    Rewriting the .live() method in terms of its successors is straightforward; these are templates for equivalent calls for all three event attachment methods:

    
    @@ -102,7 +104,7 @@ $( "p" ).live( "myCustomEvent", function( event, myName, myValue ) {
         .fadeIn( 30 )
         .fadeOut( 1000 );
       });
    -$( "button" ).click(function() {
    +$( "button" ).on( "click", function() {
       $( "p" ).trigger( "myCustomEvent" );
     });
     ]]>
    diff --git a/entries/load-event.xml b/entries/load-event.xml
    index e3739cb71..f7dbc65a7 100644
    --- a/entries/load-event.xml
    +++ b/entries/load-event.xml
    @@ -1,16 +1,15 @@
     
    -
    -  .load()
    -  Bind an event handler to the "load" JavaScript event.
    +
    +Bind an event handler to the "load" event, or trigger that event on an element.
    +
    +
    +  load event
    +  Bind an event handler to the "load" event.
       
    -    1.0
    -    
    -      A function to execute when the event is triggered.
    -      
    +    1.7
    +    
    +      The string "load".
         
    -  
    -  
    -    1.4.3
         
           An object containing data that will be passed to the event handler.
         
    @@ -20,7 +19,9 @@
         
       
       
    -    

    This method is a shortcut for .on( "load", handler ).

    +
    +

    This page describes the load event. For the .load() method removed in jQuery 3.0, see .load().

    +

    The load event is sent to an element when it and all sub-elements have been completely loaded. This event can be sent to any element associated with a URL: images, scripts, frames, iframes, and the window object.

    For example, consider a page with a simple image:

    
    @@ -28,20 +29,17 @@
         

    The event handler can be bound to the image:

    
    -$( "#book" ).load(function() {
    -  // Handler for .load() called.
    -});
    +$( "#book" ).on( "load", function() {
    +  // Handler for `load` called.
    +} );
         

    As soon as the image has been loaded, the handler is called.

    In general, it is not necessary to wait for all images to be fully loaded. If code can be executed earlier, it is usually best to place it in a handler sent to the .ready() method.

    -
    -

    The Ajax module also has a method named .load(). Which one is fired depends on the set of arguments passed.

    -

    Caveats of the load event when used with images -

    A common challenge developers attempt to solve using the .load() shortcut is to execute a function when an image (or collection of images) have completely loaded. There are several known caveats with this that should be noted. These are:

    +

    A common challenge developers attempt to solve using the load shortcut is to execute a function when an image (or collection of images) have completely loaded. There are several known caveats with this that should be noted. These are:

    • It doesn't work consistently nor reliably cross-browser
    • It doesn't fire correctly in WebKit if the image src is set to the same src as before
    • @@ -57,24 +55,40 @@ $( "#book" ).load(function() { Run a function when the page is fully loaded including graphics. Add the class bigImg to all images with height greater than 100 upon each image load. - - - + + + + + load event + Trigger the "load" event on an element. + + 1.0 + + The string "load". + + + +

      See the description for .on( "load", ... ).

      +
      + +
      + + diff --git a/entries/load-shorthand.xml b/entries/load-shorthand.xml new file mode 100644 index 000000000..1c5873cb0 --- /dev/null +++ b/entries/load-shorthand.xml @@ -0,0 +1,40 @@ + + + .load() + Bind an event handler to the "load" event, or trigger that event on an element. + + 1.0 + + A function to execute each time the event is triggered. + + + + + 1.4.3 + + An object containing data that will be passed to the event handler. + + + A function to execute each time the event is triggered. + + + + + 1.0 + + +
      +

      This API has been removed in jQuery 3.0.

      +

      Instead of .load( handler ) or .load( eventData, handler ), use .on( "load", handler ) or .on( "load", eventData, handler ), respectively.

      +

      Instead of .load(), use .trigger( "load" ).

      +
      +
      +

      The Ajax module also has a method named .load(). Which one is fired depends on the set of arguments passed.

      +
      +
      + + + + + +
      diff --git a/entries/load.xml b/entries/load.xml index 3444cb901..c0f6a46fc 100644 --- a/entries/load.xml +++ b/entries/load.xml @@ -18,12 +18,12 @@ A callback function that is executed when the request completes. - Load data from the server and place the returned HTML into the matched element. + Load data from the server and place the returned HTML into the matched elements.

      Note: Prior to jQuery 3.0, the event handling suite also had a method named .load(). Older versions of jQuery determined which method to fire based on the set of arguments passed to it.

      -

      This method is the simplest way to fetch data from the server. It is roughly equivalent to $.get(url, data, success) except that it is a method rather than global function and it has an implicit callback function. When a successful response is detected (i.e. when textStatus is "success" or "notmodified"), .load() sets the HTML contents of the matched element to the returned data. This means that most uses of the method can be quite simple:

      +

      This method is the simplest way to fetch data from the server. It is roughly equivalent to $.get(url, data, success) except that it is a method rather than global function and it has an implicit callback function. When a successful response is detected (i.e. when textStatus is "success" or "notmodified"), .load() sets the HTML contents of the matched elements to the returned data. This means that most uses of the method can be quite simple:

      
       $( "#result" ).load( "ajax/test.html" );
           
      diff --git a/entries/lt-selector.xml b/entries/lt-selector.xml index b85b5f777..703c427f1 100644 --- a/entries/lt-selector.xml +++ b/entries/lt-selector.xml @@ -1,5 +1,5 @@ - + :lt() Selector :lt(index) @@ -17,6 +17,9 @@ Select all elements at an index less than index within the matched set. +
      +

      As of jQuery 3.4, the :lt pseudo-class is deprecated. Remove it from your selectors and filter the results later using .slice(). For example, :lt(3) can be replaced with a call to .slice( 0, 3 ).

      +

      index-related selectors

      @@ -42,4 +45,5 @@ $( "td:lt(-2)" ).css( "color", "red" ); +
      diff --git a/entries/map.xml b/entries/map.xml index 55a87d83c..101fa001b 100644 --- a/entries/map.xml +++ b/entries/map.xml @@ -69,7 +69,7 @@ $( "p" )
      - +
      ]]> @@ -135,9 +135,9 @@ $.fn.equalizeHeights = function() { return this.height( Math.max.apply( this, maxHeight ) ); }; -$( "input" ).click(function() { +$( "input" ).on( "click", function() { $( "div" ).equalizeHeights(); -}); +} ); ]]> 300 - This is a playground to see how the selector works with different strings. Notice that this is different from the :even and :odd which have no regard for parent and just filter the list of elements to every other one. The :nth-child, however, counts the index of the child to its particular parent. In any case, it's easier to see than explain so... + This is a playground to see how the selector works with different strings. Notice that this is different from the even and odd which have no regard for parent and just filter the list of elements to every other one. The :nth-child, however, counts the index of the child to its particular parent. In any case, it's easier to see than explain so... @@ -94,8 +99,8 @@ $( "button" ).click(function() {
      - - + +
      diff --git a/entries/nth-last-child-selector.xml b/entries/nth-last-child-selector.xml index ce21de1fc..def39a3bd 100644 --- a/entries/nth-last-child-selector.xml +++ b/entries/nth-last-child-selector.xml @@ -10,8 +10,8 @@ Selects all elements that are the nth-child of their parent, counting from the last element to the first. -

      Because jQuery's implementation of :nth- selectors is strictly derived from the CSS specification, the value of n is "1-indexed", meaning that the counting starts at 1. For other selector expressions such as :eq() or :even jQuery follows JavaScript's "0-indexed" counting. Given a single <ul> containing three <li>s, $( "li:nth-last-child(1)" ) selects the third, last, <li>.

      -

      Further discussion of this usage can be found in the W3C CSS specification.

      +

      Because jQuery's implementation of :nth- selectors is strictly derived from the CSS specification, the value of n is "1-indexed", meaning that the counting starts at 1. For other selector expressions such as .first() or .eq() jQuery follows JavaScript's "0-indexed" counting. Given a single <ul> containing three <li>s, $( "li:nth-last-child(1)" ) selects the third, last, <li>.

      +

      Further discussion of this usage can be found in the W3C CSS specification.

      Find the second to last li in each matched ul and note it. @@ -51,7 +51,7 @@ $( "ul li:nth-last-child(2)" ).append( " - 2nd to last!" ); This is a playground to see how the selector works with different strings. + + + + + + diff --git a/entries/off.xml b/entries/off.xml index 2c711a68d..fba3925c0 100644 --- a/entries/off.xml +++ b/entries/off.xml @@ -46,13 +46,13 @@ function flash() { $( "div" ).show().fadeOut( "slow" ); } -$( "#bind" ).click(function() { +$( "#bind" ).on( "click", function() { $( "body" ) .on( "click", "#theone", flash ) .find( "#theone" ) .text( "Can Click!" ); }); -$( "#unbind" ).click(function() { +$( "#unbind" ).on( "click", function() { $( "body" ) .off( "click", "#theone", flash ) .find( "#theone" ) diff --git a/entries/offset.xml b/entries/offset.xml index 9a588ca25..819232879 100644 --- a/entries/offset.xml +++ b/entries/offset.xml @@ -11,15 +11,15 @@

      The .offset() method allows us to retrieve the current position of an element (specifically its border box, which excludes margins) relative to the document. Contrast this with .position(), which retrieves the current position relative to the offset parent. When positioning a new element on top of an existing one for global manipulation (in particular, for implementing drag-and-drop), .offset() is more useful.

      .offset() returns an object containing the properties top and left.

      -

      Note: jQuery does not support getting the offset coordinates of hidden elements or accounting for margins set on the <html> document element.

      +

      Note: jQuery does not support getting the offset coordinates of hidden elements or accounting for margins set on the <html> document element.

      While it is possible to get the coordinates of elements with visibility:hidden set, display:none is excluded from the rendering tree and thus has a position that is undefined.

      - + Access the offset of the second paragraph: @@ -35,7 +35,7 @@ p.html( "left: " + offset.left + ", top: " + offset.top ); Click to see the offset.
      - Use the the second argument of .trigger() to pass an array of data to the event handler + Use the second argument of .trigger() to pass an array of data to the event handler @@ -47,15 +47,18 @@ $( "p:last" ).text( - 1.8.0 + 1.8 A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string). + + A Boolean indicating whether to new value should account for the element's margin. + - 1.8.0 + 1.8 diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml index 4e613cc19..2c5856bea 100644 --- a/entries/outerWidth.xml +++ b/entries/outerWidth.xml @@ -18,13 +18,13 @@
      Figure 1 - Illustration of the measured width
      - + Get the outerWidth of a paragraph. @@ -47,15 +47,18 @@ $( "p:last" ).text( - 1.8.0 + 1.8 A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string). + + A Boolean indicating whether to new value should account for the element's margin. + - 1.8.0 + 1.8 diff --git a/entries/parent-selector.xml b/entries/parent-selector.xml index 424cd36ea..bd3fd7436 100644 --- a/entries/parent-selector.xml +++ b/entries/parent-selector.xml @@ -9,7 +9,7 @@

      This is the inverse of :empty.

      One important thing to note regarding the use of :parent (and :empty) is that child nodes include text nodes.

      -

      The W3C recommends that the <p> element have at least one child node, even if that child is merely text (see http://www.w3.org/TR/html401/struct/text.html#edef-P). Some other elements, on the other hand, are empty (i.e. have no children) by definition: <input>, <img>, <br>, and <hr>, for example.

      +

      The W3C recommends that the <p> element have at least one child node, even if that child is merely text (see https://www.w3.org/TR/html401/struct/text.html#edef-P). Some other elements, on the other hand, are empty (i.e. have no children) by definition: <input>, <img>, <br>, and <hr>, for example.

      To obtain the parents or ancestors of an existing jQuery set, see the .parent() and .parents() methods.

      diff --git a/entries/parents.xml b/entries/parents.xml index 403b23936..ab51cde99 100644 --- a/entries/parents.xml +++ b/entries/parents.xml @@ -82,7 +82,7 @@ function showParents() { .length; $( "b" ).text( "Unique div parents: " + len ); } -$( "span" ).click(function() { +$( "span" ).on( "click", function() { $( this ).toggleClass( "selected" ); showParents(); }); diff --git a/entries/password-selector.xml b/entries/password-selector.xml index 8d632b8f6..053e0dc29 100644 --- a/entries/password-selector.xml +++ b/entries/password-selector.xml @@ -13,18 +13,18 @@ Finds all password inputs. + + + Locate all the divs preceding the last item and wrap them with a div with class wrapper - with or without .uniqueSort(). + + + diff --git a/entries/prop.xml b/entries/prop.xml index 419c3cc21..5506d40b9 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -42,17 +42,10 @@ $( elem ).attr( "checked" ) - (1.6) + (1.6+) "checked" (String) Initial state of the checkbox; does not change - - - $( elem ).attr( "checked" ) - (1.6.1+) - - "checked" (String) Will change with checkbox state - $( elem ).attr( "checked" ) @@ -62,7 +55,7 @@
      -

      According to the W3C forms specification, the checked attribute is a boolean attribute, which means the corresponding property is true if the attribute is present at all—even if, for example, the attribute has no value or is set to empty string value or even "false". This is true of all boolean attributes.

      +

      According to the W3C forms specification, the checked attribute is a boolean attribute, which means the corresponding property is true if the attribute is present at all—even if, for example, the attribute has no value or is set to empty string value or even "false". This is true of all boolean attributes.

      Nevertheless, the most important concept to remember about the checked attribute is that it does not correspond to the checked property. The attribute actually corresponds to the defaultChecked property and should be used only to set the initial value of the checkbox. The checked attribute value does not change with the state of the checkbox, while the checked property does. Therefore, the cross-browser-compatible way to determine if a checkbox is checked is to use the property:

      • @@ -81,13 +74,13 @@ Display the checked property and attribute of a checkbox as it changes. " ) .parent() - .css({ + .css( { background: "yellow", border: "3px red solid" - }); + } ); $( "div" ) .text( "For this type jQuery found " + input.length + "." ) .css( "color", "red" ); // Prevent form submission -$( "form" ).submit(function( event ) { +$( "form" ).on( "submit", function( event ) { event.preventDefault(); -}); +} ); ]]> diff --git a/entries/removeAttr.xml b/entries/removeAttr.xml index 92a92b228..6df348209 100644 --- a/entries/removeAttr.xml +++ b/entries/removeAttr.xml @@ -22,7 +22,7 @@ console.log( "onclick property: ", $element[ 0 ].onclick ); - - - - - Remove the class 'blue' and 'under' from the matched elements. - - - - - - Remove all the classes from the matched elements. - - - - - - - - - - + + .removeClass() + + 1.0 + + One or more space-separated classes to be removed from the class attribute of each matched element. + + + + 3.3 + + An array of classes to be removed from the class attribute of each matched element. + + + + 1.4 + + + + + A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + + + + 3.3 + + + + + + A function returning one or more space-separated class names or an array of class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + + + Remove a single class or multiple classes from each element in the set of matched elements. + +

        Before jQuery version 1.12/2.2, the .removeClass() method manipulated the className property of the selected elements, not the class attribute. Once the property was changed, it was the browser that updated the attribute accordingly. This means that when the class attribute was updated and the last class name was removed, the browser might have set the attribute's value to an empty string instead of removing the attribute completely. An implication of this behavior was that this method only worked for documents with HTML DOM semantics (e.g., not pure XML documents).

        +

        As of jQuery 1.12/2.2, this behavior is changed to improve the support for XML documents, including SVG. Starting from this version, the class attribute is used instead. So, .removeClass() can be used on XML or SVG documents.

        +

        More than one class may be removed at a time, separated by a space, from the set of matched elements, like so:

        +
        
        +  $( "p" ).removeClass( "myClass yourClass" )
        +      
        +

        This method is often used with .addClass() to switch elements' classes from one to another, like so:

        +
        
        +  $( "p" ).removeClass( "myClass noClass" ).addClass( "yourClass" );
        +      
        +

        Here, the myClass and noClass classes are removed from all paragraphs, while yourClass is added.

        +

        To replace all existing classes with another class, we can use .attr( "class", "newClass" ) instead.

        +

        As of jQuery 1.4, the .removeClass() method allows us to indicate the class to be removed by passing in a function.

        +
        
        +  $( "li" ).last().removeClass(function() {
        +    return $( this ).prev().attr( "class" );
        +  });
        +      
        +

        This example removes the class name of the penultimate <li> from the last <li>.

        +
        + + Remove the class 'blue' from the matched elements. + + + + + + Remove the class 'blue' and 'under' from the matched elements. + + + + + + Remove the class 'blue' and 'under' from the matched elements (3.3+ syntax). + + + + + + + + + + + +
        + + + + 1.0 + + Remove all classes from each matched element. + +

        Before jQuery version 1.12/2.2, the .removeClass() method manipulated the className property of the selected elements, not the class attribute. Once the property was changed, it was the browser that updated the attribute accordingly. This means that when the class attribute was updated and the last class name was removed, the browser might have set the attribute's value to an empty string instead of removing the attribute completely. An implication of this behavior was that this method only worked for documents with HTML DOM semantics (e.g., not pure XML documents).

        +

        As of jQuery 1.12/2.2, this behavior is changed to improve the support for XML documents, including SVG. Starting from this version, the class attribute is used instead. So, .removeClass() can be used on XML or SVG documents.

        +
        + + Remove all the classes from the matched elements. + + + + + + + + + +
        + diff --git a/entries/removeData.xml b/entries/removeData.xml index 3c2cf8ff4..e4dd08b1f 100644 --- a/entries/removeData.xml +++ b/entries/removeData.xml @@ -28,13 +28,13 @@ Set a data store for 2 names then remove one of them. @@ -108,7 +108,7 @@ $( "p" ).replaceWith( "Paragraph. " ); On click, replace each paragraph with a div that is already in the DOM and selected with the $() function. Notice it doesn't clone the object but rather moves it to replace the paragraph. diff --git a/entries/reset-selector.xml b/entries/reset-selector.xml index 301b0e5e2..db5586086 100644 --- a/entries/reset-selector.xml +++ b/entries/reset-selector.xml @@ -13,18 +13,18 @@ Finds all reset inputs. - + + + + + resize event + Trigger the "resize" event on an element. + + 1.0 + + The string "resize". + + + +

        See the description for .on( "resize", ... ).

        +
        + +
        + + diff --git a/entries/scroll-shorthand.xml b/entries/scroll-shorthand.xml new file mode 100644 index 000000000..67b7997ed --- /dev/null +++ b/entries/scroll-shorthand.xml @@ -0,0 +1,36 @@ + + + .scroll() + Bind an event handler to the "scroll" event, or trigger that event on an element. + + 1.0 + + A function to execute each time the event is triggered. + + + + + 1.4.3 + + An object containing data that will be passed to the event handler. + + + A function to execute each time the event is triggered. + + + + + 1.0 + + +
        +

        This API is deprecated.

        +

        Instead of .scroll( handler ) or .scroll( eventData, handler ), use .on( "scroll", handler ) or .on( "scroll", eventData, handler ), respectively.

        +

        Instead of .scroll(), use .trigger( "scroll" ).

        +
        +
        + + + + +
        diff --git a/entries/scroll.xml b/entries/scroll.xml index 8529cb0c7..5f46ddfe0 100644 --- a/entries/scroll.xml +++ b/entries/scroll.xml @@ -1,16 +1,15 @@ - - .scroll() - Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. + + +Bind an event handler to the "scroll" event, or trigger that event on an element. + + scroll event + Bind an event handler to the "scroll" event. - 1.0 - - A function to execute each time the event is triggered. - + 1.7 + + The string "scroll". - - - 1.4.3 An object containing data that will be passed to the event handler. @@ -19,11 +18,10 @@ - - 1.0 - -

        This method is a shortcut for .on( "scroll", handler ) in the first and second variations, and .trigger( "scroll" ) in the third.

        +
        +

        This page describes the scroll event. For the deprecated .scroll() method, see .scroll().

        +

        The scroll event is sent to an element when the user scrolls to a different place in the element. It applies to window objects, but also to scrollable frames and elements with the overflow CSS property set to scroll (or auto when the element's explicit height or width is less than the height or width of its contents).

        For example, consider the HTML:

        
        @@ -41,7 +39,7 @@
           Trigger the handler
         </div>
         <div id="log"></div>
        -
        +

    The style definition is present to make the target element small enough to be scrollable:

    @@ -49,33 +47,32 @@

    The scroll event handler can be bound to this element:

    
    -$( "#target" ).scroll(function() {
    -  $( "#log" ).append( "<div>Handler for .scroll() called.</div>" );
    -});
    +$( "#target" ).on( "scroll", function() {
    +  $( "#log" ).append( "<div>Handler for `scroll` called.</div>" );
    +} );
         

    Now when the user scrolls the text up or down, one or more messages are appended to <div id="log"></div>:

    - Handler for .scroll() called. + Handler for `scroll` called.

    -

    To trigger the event manually, apply .scroll() without an argument:

    +

    To trigger the event manually, use .trigger( "scroll" ):

    
    -$( "#other" ).click(function() {
    -  $( "#target" ).scroll();
    -});
    +$( "#other" ).on( "click", function() {
    +  $( "#target" ).trigger( "scroll" );
    +} );
         

    After this code executes, clicks on Trigger the handler will also append the message.

    A scroll event is sent whenever the element's scroll position changes, regardless of the cause. A mouse click or drag on the scroll bar, dragging inside the element, pressing the arrow keys, or using the mouse's scroll wheel could cause this event.

    - To do something when your page is scrolled: - + + + + + select event + Trigger the "select" event on an element. + + 1.0 + + The string "select". + + + +

    See the description for .on( "select", ... ).

    +
    + +
    + + diff --git a/entries/selected-selector.xml b/entries/selected-selector.xml index c96bf422f..5eb6cef8d 100644 --- a/entries/selected-selector.xml +++ b/entries/selected-selector.xml @@ -14,13 +14,13 @@ Attaches a change event to the select that gets the text for each selected option and writes them in the div. It then triggers the event for the initial text draw. @@ -84,13 +84,13 @@ $( "button" ).click(function() { Show the first div, followed by each next adjacent sibling div in order, with a 200ms animation. Each animation starts when the previous sibling div's animation ends. @@ -120,19 +120,19 @@ function doIt() { $( "span,div" ).show( "slow" ); } // Can pass in function name -$( "button" ).click( doIt ); +$( "button" ).on( "click", doIt ); -$( "form" ).submit(function( event ) { +$( "form" ).on( "submit", function( event ) { if ( $( "input" ).val() === "yes" ) { $( "p" ).show( 4000, function() { $( this ).text( "Ok, DONE! (now showing)" ); - }); + } ); } $( "span,div" ).hide( "fast" ); // Prevent form submission event.preventDefault(); -}); +} ); ]]> - - diff --git a/entries/slice.xml b/entries/slice.xml index 81d76c989..8f94ce16a 100644 --- a/entries/slice.xml +++ b/entries/slice.xml @@ -62,7 +62,7 @@ function colorEm() { ").css( 'background', 'yellow' );" ); } -$( "button" ).click( colorEm ); +$( "button" ).on( "click", colorEm ); ]]> @@ -84,7 +84,7 @@ $( "button" ).click(function() { Animates divs between dividers with a toggle that makes some appear and some disappear. diff --git a/entries/submit-selector.xml b/entries/submit-selector.xml index a4c9aa01d..f6c48b8ff 100644 --- a/entries/submit-selector.xml +++ b/entries/submit-selector.xml @@ -15,25 +15,25 @@ " ); -}) +} ); ]]> To trigger the submit event on the first form on the page, try: - + + + + submit event + Trigger the "submit" event on an element. + + 1.0 + + The string "submit". + + + +

    See the description for .on( "submit", ... ).

    +
    + + +
    + + diff --git a/entries/target-selector.xml b/entries/target-selector.xml index 5d60f3dab..b010a5ced 100644 --- a/entries/target-selector.xml +++ b/entries/target-selector.xml @@ -7,8 +7,8 @@ Selects the target element indicated by the fragment identifier of the document's URI. -

    If the document's URI contains a fragment identifier, or hash, then the :target selector will match the element with an ID that matches the identifier. For example, given a document with a URI of http://example.com/#foo, $( "p:target" ) will select the <p id="foo"> element.

    -

    Further discussion of this usage can be found in the W3C CSS specification.

    +

    If the document's URI contains a fragment identifier, or hash, then the :target selector will match the element with an ID that matches the identifier. For example, given a document with a URI of https://example.com/#foo, $( "p:target" ) will select the <p id="foo"> element.

    +

    Further discussion of this usage can be found in the W3C CSS specification.

    diff --git a/entries/text-selector.xml b/entries/text-selector.xml index 9af4dc445..4886c3a50 100644 --- a/entries/text-selector.xml +++ b/entries/text-selector.xml @@ -19,19 +19,19 @@ $( "<input>" ).is( ":text" ); // true Finds all text inputs. @@ -126,7 +126,7 @@ $( "button" ).click(function() { Shows all paragraphs, then hides them all, back and forth. diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml index dfe45f2d0..b42f23290 100644 --- a/entries/toggleClass.xml +++ b/entries/toggleClass.xml @@ -5,16 +5,31 @@ 1.0 - One or more class names (separated by spaces) to be toggled for each element in the matched set. + One or more classes (separated by spaces) to be toggled for each element in the matched set. 1.3 - One or more class names (separated by spaces) to be toggled for each element in the matched set. + One or more classes (separated by spaces) to be toggled for each element in the matched set. - A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + A boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + + + + 3.3 + + An array of classes to be toggled for each element in the matched set. + + + + 3.3 + + An array of classes to be toggled for each element in the matched set. + + + A boolean (not just truthy/falsy) value to determine whether the class should be added or removed. @@ -24,7 +39,21 @@ - A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. + A function returning one or more space-separated class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. + + + A boolean value to determine whether the class should be added or removed. + + + + 3.3 + + + + + + + A function returning one or more space-separated class names or an array of class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. A boolean value to determine whether the class should be added or removed. @@ -32,7 +61,7 @@ Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument. -

    This method takes one or more class names as its parameter. In the first version, if an element in the matched set of elements already has the class, then it is removed; if an element does not have the class, then it is added. For example, we can apply .toggleClass() to a simple <div>:

    +

    This method takes one or more classes as its parameter. In the first version, if an element in the matched set of elements already has the class, then it is removed; if an element does not have the class, then it is added. For example, we can apply .toggleClass() to a simple <div>:

    
     <div class="tumble">Some text.</div>
           
    @@ -55,7 +84,7 @@ if ( addOrRemove ) { $( "#foo" ).removeClass( className ); }
    -

    As of jQuery 1.4, if no arguments are passed to .toggleClass(), all class names on the element the first time .toggleClass() is called will be toggled. Also as of jQuery 1.4, the class name to be toggled can be determined by passing in a function.

    +

    As of jQuery 1.4, if no arguments are passed to .toggleClass(), all classes on the element the first time .toggleClass() is called will be toggled. Also as of jQuery 1.4, the class name to be toggled can be determined by passing in a function.

    
     $( "div.foo" ).toggleClass(function() {
       if ( $( this ).parent().is( ".bar" ) ) {
    @@ -70,7 +99,7 @@ $( "div.foo" ).toggleClass(function() {
         
           Toggle the class 'highlight' when a paragraph is clicked.
           
    @@ -99,15 +128,15 @@ $( "p" ).click(function() {
           Add the "highlight" class to the clicked paragraph on every third click of that paragraph, remove it every first and second click.
           
           
         Clicks to button #2 also trigger a click for button #1.
         
       
       
         To submit the first form without using the submit() function, try:
         
       
    diff --git a/entries/triggerHandler.xml b/entries/triggerHandler.xml
    index d72516a8d..83b2a576f 100644
    --- a/entries/triggerHandler.xml
    +++ b/entries/triggerHandler.xml
    @@ -37,15 +37,15 @@
       
         If you called .triggerHandler() on a focus event - the browser's default focus action would not be triggered, only the event handlers bound to the focus event.
         
         
    +    
    +    
    +  
    +  
    +    Locate all the divs preceding the last item and wrap them with a div with class wrapper - with or without .uniqueSort().
    +    
    +    
    +    
    +  
    +  
    +  
    +
    diff --git a/entries/unload-shorthand.xml b/entries/unload-shorthand.xml
    new file mode 100644
    index 000000000..693768ecd
    --- /dev/null
    +++ b/entries/unload-shorthand.xml
    @@ -0,0 +1,37 @@
    +
    +
    +  .unload()
    +  Bind an event handler to the "unload" event, or trigger that event on an element.
    +  
    +    1.0
    +    
    +      A function to execute each time the event is triggered.
    +      
    +    
    +  
    +  
    +    1.4.3
    +    
    +      An object containing data that will be passed to the event handler.
    +    
    +    
    +      A function to execute each time the event is triggered.
    +      
    +    
    +  
    +  
    +    1.0
    +  
    +  
    +    
    +

    This API has been removed in jQuery 3.0.

    +

    Instead of .unload( handler ) or .unload( eventData, handler ), use .on( "unload", handler ) or .on( "unload", eventData, handler ), respectively.

    +

    Instead of .unload(), use .trigger( "unload" ).

    +
    +
    + + + + + +
    diff --git a/entries/unload.xml b/entries/unload.xml index 1306ddd6d..05d1c27a4 100644 --- a/entries/unload.xml +++ b/entries/unload.xml @@ -1,15 +1,15 @@ - - .unload() + +Bind an event handler to the "unload" event, or trigger that event on an element. + + + unload event + Bind an event handler to the "unload" event. - 1.0 - - A function to execute when the event is triggered. - + 1.7 + + The string "unload". - - - 1.4.3 A plain object of data that will be passed to the event handler. @@ -18,33 +18,49 @@ - Bind an event handler to the "unload" JavaScript event. -

    This method is a shortcut for .on( "unload", handler ).

    +
    +

    This page describes the unload event. For the .unload() method removed in jQuery 3.0, see .unload().

    +

    The unload event is sent to the window element when the user navigates away from the page. This could mean one of many things. The user could have clicked on a link to leave the page, or typed in a new URL in the address bar. The forward and back buttons will trigger the event. Closing the browser window will cause the event to be triggered. Even a page reload will first create an unload event.

    The exact handling of the unload event has varied from version to version of browsers. For example, some versions of Firefox trigger the event when a link is followed, but not when the window is closed. In practical usage, behavior should be tested on all supported browsers and contrasted with the similar beforeunload event.

    Any unload event handler should be bound to the window object:

    
    -$( window ).unload(function() {
    -  return "Handler for .unload() called.";
    -});
    +$( window ).on( "unload", function() {
    +  return "Handler for `unload` called.";
    +} );
         

    This event is available so that scripts can perform cleanup when the user leaves the page. Most browsers will ignore calls to alert(), confirm() and prompt() inside the event handler. The string you return may be used in a confirmation dialog, but not all browsers support this. It is not possible to cancel the unload event with .preventDefault().

    - To display an alert when a page is unloaded: - - - + +
    + + + unload event + Trigger the "unload" event on an element. + + 1.0 + + The string "unload". + + + +

    See the description for .on( "unload", ... ).

    +
    + +
    + +
    diff --git a/entries/unwrap.xml b/entries/unwrap.xml index d3a7b405d..b2dde6046 100644 --- a/entries/unwrap.xml +++ b/entries/unwrap.xml @@ -12,13 +12,13 @@ Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. -

    The .unwrap() method removes the element's parent. This is effectively the inverse of the .wrap() method. The matched elements (and their siblings, if any) replace their parents within the DOM structure.

    +

    The .unwrap() method removes the element's parent and returns the unwrapped content. This is effectively the inverse of the .wrap() method. The matched elements (and their siblings, if any) replace their parents within the DOM structure.

    Wrap/unwrap a div around each of the paragraphs. Set the value of an input box. = 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" } }, - "domutils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.4.3.tgz", - "integrity": "sha1-CGVRN5bGswYDGFDhdVFrr4C3Km8=", - "requires": { - "domelementtype": "1.3.0" + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" } }, - "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=" + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } }, - "esprima": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz", - "integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0=" + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } }, - "eventemitter2": { + "node_modules/eventemitter2": { "version": "0.4.14", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=" }, - "exit": { + "node_modules/exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" - }, - "findup-sync": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz", - "integrity": "sha1-fz56l7gjksZTvwZYm9hRkOk8NoM=", - "requires": { - "glob": "3.2.11", - "lodash": "2.4.2" - }, - "dependencies": { - "glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", - "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", - "requires": { - "inherits": "2.0.3", - "minimatch": "0.3.0" - } - }, - "lodash": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" - }, - "minimatch": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", - "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", - "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" - } - } + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "engines": { + "node": ">= 0.8.0" } }, - "getobject": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", - "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=" + "node_modules/expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } }, - "gilded-wordpress": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/gilded-wordpress/-/gilded-wordpress-1.0.3.tgz", - "integrity": "sha1-kh/iJ93yWyxAgp5QUjsOMXRDsz4=", - "requires": { - "async": "0.9.2", - "glob": "4.0.6", - "wordpress": "1.1.2" - }, - "dependencies": { - "async": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" - }, - "glob": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz", - "integrity": "sha1-aVxQvdTi+1xdNwsJHziNNwfikac=", - "requires": { - "graceful-fs": "3.0.11", - "inherits": "2.0.3", - "minimatch": "1.0.0", - "once": "1.4.0" - } - }, - "graceful-fs": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", - "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", - "requires": { - "natives": "1.1.0" - } - }, - "minimatch": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", - "integrity": "sha1-4N0hILSeG3JM6NcUxSCCKpQ4V20=", - "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" - } - } + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "glob": { - "version": "3.1.21", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", - "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", - "requires": { - "graceful-fs": "1.2.3", - "inherits": "1.0.2", - "minimatch": "0.2.14" + "node_modules/findup-sync": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-5.0.0.tgz", + "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.3", + "micromatch": "^4.0.4", + "resolve-dir": "^1.0.1" }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/fined": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", "dependencies": { - "inherits": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", - "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=" - } + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" } }, - "graceful-fs": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", - "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=" - }, - "grunt": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-0.4.5.tgz", - "integrity": "sha1-VpN81RlDJK3/bSB2MYMqnWuk5/A=", - "requires": { - "async": "0.1.22", - "coffee-script": "1.3.3", - "colors": "0.6.2", - "dateformat": "1.0.2-1.2.3", - "eventemitter2": "0.4.14", - "exit": "0.1.2", - "findup-sync": "0.1.3", - "getobject": "0.1.0", - "glob": "3.1.21", - "grunt-legacy-log": "0.1.3", - "grunt-legacy-util": "0.2.0", - "hooker": "0.2.3", - "iconv-lite": "0.2.11", - "js-yaml": "2.0.5", - "lodash": "0.9.2", - "minimatch": "0.2.14", - "nopt": "1.0.10", - "rimraf": "2.2.8", - "underscore.string": "2.2.1", - "which": "1.0.9" - } - }, - "grunt-check-modules": { + "node_modules/flagged-respawn": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-own": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/grunt-check-modules/-/grunt-check-modules-1.0.0.tgz", - "integrity": "sha1-Y/9erkYTF5tKifaozTcfekAfd4I=" + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dependencies": { + "for-in": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/getobject": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.2.tgz", + "integrity": "sha512-2zblDBaFcb3rB4rF77XVnuINOE2h2k/OnqXAiy0IrTxUfV1iFp3la33oAQVY9pCpWU268WFYVt2t71hlMuLsOg==", + "engines": { + "node": ">=10" + } + }, + "node_modules/gilded-wordpress": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/gilded-wordpress/-/gilded-wordpress-1.0.7.tgz", + "integrity": "sha512-w8g4jfs1TWywX2hZ4+LlzQoz2z/JRX/8S6OgelD3IUsNnGHxXQ1FgExoIqomwZVPAmxYs0vEu2BeA1Y4KciZlw==", + "dependencies": { + "async": "^0.9.0", + "wordpress": "^1.4.2" + } }, - "grunt-cli": { + "node_modules/gilded-wordpress/node_modules/async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha512-l6ToIJIotphWahxxHyzK9bnLR6kM4jJIIgLShZeqLY7iboHoGkdgFl7W2/Ivi4SkMJYGKqW8vSuk0uKUj6qsSw==" + }, + "node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dependencies": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dependencies": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.6.1.tgz", + "integrity": "sha512-/ABUy3gYWu5iBmrUSRBP97JLpQUm0GgVveDCp6t3yRNIoltIYw7rEj3g5y1o2PGPR2vfTRGa7WC/LZHLTXnEzA==", + "dependencies": { + "dateformat": "~4.6.2", + "eventemitter2": "~0.4.13", + "exit": "~0.1.2", + "findup-sync": "~5.0.0", + "glob": "~7.1.6", + "grunt-cli": "~1.4.3", + "grunt-known-options": "~2.0.0", + "grunt-legacy-log": "~3.0.0", + "grunt-legacy-util": "~2.0.1", + "iconv-lite": "~0.6.3", + "js-yaml": "~3.14.0", + "minimatch": "~3.0.4", + "nopt": "~3.0.6" + }, + "bin": { + "grunt": "bin/grunt" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/grunt-check-modules": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.1.0.tgz", - "integrity": "sha1-r9eWmTTd8zYg6ER+3B+pTlHlWjQ=", - "requires": { - "findup-sync": "0.3.0", - "nopt": "3.0.6", - "resolve": "1.1.7" - }, - "dependencies": { - "findup-sync": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", - "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", - "requires": { - "glob": "5.0.15" - } - }, - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "1.1.8" - } - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "requires": { - "abbrev": "1.1.0" - } - } + "resolved": "https://registry.npmjs.org/grunt-check-modules/-/grunt-check-modules-1.1.0.tgz", + "integrity": "sha1-fBZB28ZlSGdqbVl5Ga35C3s11kQ=", + "engines": { + "node": ">=0.6.0" + }, + "peerDependencies": { + "grunt": ">=0.4.0" } }, - "grunt-jquery-content": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/grunt-jquery-content/-/grunt-jquery-content-3.0.1.tgz", - "integrity": "sha1-aHdrx0G1SVEdaPBouVCsizd+g90=", - "requires": { - "async": "0.9.0", - "cheerio": "0.17.0", - "grunt-check-modules": "1.0.0", - "grunt-wordpress": "2.1.2", - "he": "0.5.0", - "highlight.js": "7.3.0", - "marked": "0.3.2", - "rimraf": "2.2.8", - "spawnback": "1.0.0", - "which": "1.0.5", - "wordpress": "1.1.2" - }, - "dependencies": { - "async": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz", - "integrity": "sha1-rDYTsdqb7RtHUQu0ZRuJMeRxRsc=" - }, - "which": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz", - "integrity": "sha1-VjDWgZ3aaS8UZEYueVbLQsCEJzk=" - } + "node_modules/grunt-jquery-content": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/grunt-jquery-content/-/grunt-jquery-content-3.3.2.tgz", + "integrity": "sha512-b6w8GBe022BG8O7BkhAKBFcBBAldoIiwAUZ2WI+A8HIouXy8XS8Cwp2RuUPEACg3g2/wHOarmjrsFKFPmmZ55Q==", + "dependencies": { + "cheerio": "^1.0.0-rc.12", + "gilded-wordpress": "1.0.7", + "grunt-check-modules": "^1.1.0", + "he": "^1.2.0", + "highlight.js": "^10.7.2", + "marked": "^4.0.0", + "which": "^4.0.0", + "wordpress": "^1.4.1" } }, - "grunt-legacy-log": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-0.1.3.tgz", - "integrity": "sha1-7ClCboAwIa9ZAp+H0vnNczWgVTE=", - "requires": { - "colors": "0.6.2", - "grunt-legacy-log-utils": "0.1.1", - "hooker": "0.2.3", - "lodash": "2.4.2", - "underscore.string": "2.3.3" - }, - "dependencies": { - "lodash": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" - }, - "underscore.string": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", - "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0=" - } + "node_modules/grunt-jquery-content/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "engines": { + "node": ">=16" } }, - "grunt-legacy-log-utils": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-0.1.1.tgz", - "integrity": "sha1-wHBrndkGThFvNvI/5OawSGcsD34=", - "requires": { - "colors": "0.6.2", - "lodash": "2.4.2", - "underscore.string": "2.3.3" - }, - "dependencies": { - "lodash": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" - }, - "underscore.string": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", - "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0=" - } + "node_modules/grunt-jquery-content/node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" } }, - "grunt-legacy-util": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz", - "integrity": "sha1-kzJIhNv343qf98Am3/RR2UqeVUs=", - "requires": { - "async": "0.1.22", - "exit": "0.1.2", - "getobject": "0.1.0", - "hooker": "0.2.3", - "lodash": "0.9.2", - "underscore.string": "2.2.1", - "which": "1.0.9" + "node_modules/grunt-legacy-log": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz", + "integrity": "sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==", + "dependencies": { + "colors": "~1.1.2", + "grunt-legacy-log-utils": "~2.1.0", + "hooker": "~0.2.3", + "lodash": "~4.17.19" + }, + "engines": { + "node": ">= 0.10.0" } }, - "grunt-wordpress": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/grunt-wordpress/-/grunt-wordpress-2.1.2.tgz", - "integrity": "sha1-ue3Lv5jp6HM9F6gsMmWf2zbO2LE=", - "requires": { - "gilded-wordpress": "1.0.3" + "node_modules/grunt-legacy-log-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.1.0.tgz", + "integrity": "sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==", + "dependencies": { + "chalk": "~4.1.0", + "lodash": "~4.17.19" + }, + "engines": { + "node": ">=10" } }, - "he": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/he/-/he-0.5.0.tgz", - "integrity": "sha1-LAX/rvkLaOhg8/0rVO9YCYknfuI=" + "node_modules/grunt-legacy-util": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-2.0.1.tgz", + "integrity": "sha512-2bQiD4fzXqX8rhNdXkAywCadeqiPiay0oQny77wA2F3WF4grPJXCvAcyoWUJV+po/b15glGkxuSiQCK299UC2w==", + "dependencies": { + "async": "~3.2.0", + "exit": "~0.1.2", + "getobject": "~1.0.0", + "hooker": "~0.2.3", + "lodash": "~4.17.21", + "underscore.string": "~3.3.5", + "which": "~2.0.2" + }, + "engines": { + "node": ">=10" + } }, - "highlight.js": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-7.3.0.tgz", - "integrity": "sha1-bF8PZOcHj2ZAK82/yJEQw/0bqZ8=" + "node_modules/grunt-legacy-util/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } }, - "hooker": { + "node_modules/grunt/node_modules/grunt-cli": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.3.tgz", + "integrity": "sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==", + "dependencies": { + "grunt-known-options": "~2.0.0", + "interpret": "~1.1.0", + "liftup": "~3.0.1", + "nopt": "~4.0.1", + "v8flags": "~3.2.0" + }, + "bin": { + "grunt": "bin/grunt" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/grunt/node_modules/grunt-cli/node_modules/nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "dependencies": { + "abbrev": "1", + "osenv": "^0.1.4" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/grunt/node_modules/grunt-known-options": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", + "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "bin": { + "he": "bin/he" + } + }, + "node_modules/highlight.js": { + "version": "10.7.2", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.2.tgz", + "integrity": "sha512-oFLl873u4usRM9K63j4ME9u3etNF0PLiJhSQ8rdfuL51Wn3zkD6drf9ZW0dOzjnZI22YYG24z30JcmfCZjMgYg==", + "engines": { + "node": "*" + } + }, + "node_modules/homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dependencies": { + "parse-passwd": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hooker": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", - "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=" - }, - "htmlparser2": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.7.3.tgz", - "integrity": "sha1-amTHdjfAjG8w7CqBV6UzM758sF4=", - "requires": { - "domelementtype": "1.3.0", - "domhandler": "2.2.1", - "domutils": "1.5.1", - "entities": "1.0.0", - "readable-stream": "1.1.14" - }, - "dependencies": { - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", - "requires": { - "dom-serializer": "0.0.1", - "domelementtype": "1.3.0" - } - }, - "entities": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", - "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" + "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=", + "engines": { + "node": "*" + } + }, + "node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" } }, - "iconv-lite": { - "version": "0.2.11", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz", - "integrity": "sha1-HOYKOleGSiktEyH/RgnKS7llrcg=" + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } }, - "inflight": { + "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" } }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, - "js-yaml": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-2.0.5.tgz", - "integrity": "sha1-olrmUJmZ6X3yeMZxnaEb0Gh3Q6g=", - "requires": { - "argparse": "0.1.16", - "esprima": "1.0.4" + "node_modules/interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=" + }, + "node_modules/is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dependencies": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "lodash": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz", - "integrity": "sha1-jzSZxSRdNG1oLlsNO0B2fgnxqSw=" + "node_modules/is-core-module": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dependencies": { + "is-unc-path": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dependencies": { + "unc-path-regex": "^0.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } }, - "lru-cache": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=" + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "engines": { + "node": ">=0.10.0" + } }, - "marked": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz", - "integrity": "sha1-AV2xWIZEOPJKZL3WGgQotBhwbQk=" + "node_modules/liftup": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/liftup/-/liftup-3.0.1.tgz", + "integrity": "sha512-yRHaiQDizWSzoXk3APcA71eOI/UuhEkNN9DiW2Tt44mhYzX4joFoCZlxsSOF7RyeLlfqzFLQI1ngFq3ggMPhOw==", + "dependencies": { + "extend": "^3.0.2", + "findup-sync": "^4.0.0", + "fined": "^1.2.0", + "flagged-respawn": "^1.0.1", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.1", + "rechoir": "^0.7.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">=10" + } }, - "minimatch": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", - "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "node_modules/liftup/node_modules/findup-sync": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-4.0.0.tgz", + "integrity": "sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==", + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^4.0.2", + "resolve-dir": "^1.0.1" + }, + "engines": { + "node": ">= 8" } }, - "natives": { + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/object.defaults": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz", - "integrity": "sha1-6f+EFBimsux6SV6TmYT3jxY+bjE=" + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dependencies": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } }, - "nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", - "requires": { - "abbrev": "1.1.0" + "node_modules/object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "dependencies": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "once": { + "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1.0.2" + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dependencies": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "node_modules/parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "dependencies": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "path-is-absolute": { + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "dependencies": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" - }, - "rimraf": { - "version": "2.2.8", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", - "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=" - }, - "sax": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz", - "integrity": "sha1-VjsZx8HeiS4Jv8Ty/DDjwn8JUrk=" - }, - "sigmund": { + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "dependencies": { + "path-root-regex": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/rechoir": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", + "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", + "dependencies": { + "resolve": "^1.9.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-dir": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dependencies": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } }, - "spawnback": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.0.tgz", - "integrity": "sha1-9zZi9+VNlTZ+ynTWQmxnfdfqaG8=" - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "underscore": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", - "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=" - }, - "underscore.string": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.2.1.tgz", - "integrity": "sha1-18D6KvXVoaZ/QlPa7pgTLnM/Dxk=" - }, - "which": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz", - "integrity": "sha1-RgwdoPgQED0DIam2M6+eV15kSG8=" - }, - "wordpress": { + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "node_modules/sprintf-js": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/wordpress/-/wordpress-1.1.2.tgz", - "integrity": "sha1-uDZhhSBVSXESG8VsQ7A5yzgg94M=", - "requires": { - "xmlrpc": "1.3.1" + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "engines": { + "node": ">=0.10.0" + } }, - "xmlbuilder": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-2.6.5.tgz", - "integrity": "sha1-b/etYPty0idk8AehZLd/K/FABSY=", - "requires": { - "lodash": "3.10.1" + "node_modules/underscore.string": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.6.tgz", + "integrity": "sha512-VoC83HWXmCrF6rgkyxS9GHv8W9Q5nhMKho+OadDJGzL2oDYbYEppBaCMH6pFlwLeqj2QS+hhkw2kpXkSdD1JxQ==", + "dependencies": { + "sprintf-js": "^1.1.1", + "util-deprecate": "^1.0.2" }, + "engines": { + "node": "*" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "node_modules/v8flags": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", "dependencies": { - "lodash": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", - "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" - } + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" } }, - "xmlrpc": { + "node_modules/which": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/xmlrpc/-/xmlrpc-1.3.1.tgz", - "integrity": "sha1-OqWCCG/vUwz+Hc2qDEyd3F0ORFE=", - "requires": { - "sax": "0.6.1", - "xmlbuilder": "2.6.5" + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/wordpress": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/wordpress/-/wordpress-1.4.2.tgz", + "integrity": "sha512-T+o+Af6pK7mhTz/rJEZk4PpSIyRMVhx6vZm6UsmrnlL8pVudhu1gWzn1n3wZXlcEZQz7I0AOkEvPQ5hu++L+qg==", + "dependencies": { + "xmlrpc": "1.3.2" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/xmlbuilder": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz", + "integrity": "sha512-eKRAFz04jghooy8muekqzo8uCSVNeyRedbuJrp0fovbLIi7wlsYtdUn3vBAAPq2Y3/0xMz2WMEUQ8yhVVO9Stw==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/xmlrpc": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/xmlrpc/-/xmlrpc-1.3.2.tgz", + "integrity": "sha512-jQf5gbrP6wvzN71fgkcPPkF4bF/Wyovd7Xdff8d6/ihxYmgETQYSuTc+Hl+tsh/jmgPLro/Aro48LMFlIyEKKQ==", + "dependencies": { + "sax": "1.2.x", + "xmlbuilder": "8.2.x" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.0.0" } } } diff --git a/package.json b/package.json index d388b15a8..458873eac 100644 --- a/package.json +++ b/package.json @@ -1,31 +1,12 @@ { "name": "api.jquery.com", - "title": "jQuery API Docs", - "description": "API reference documentation for the jQuery JavaScript Library.", - "version": "1.12.28", - "homepage": "https://github.com/jquery/api.jquery.com", - "author": { - "name": "jQuery Foundation and other contributors" - }, - "repository": { - "type": "git", - "url": "git://github.com/jquery/api.jquery.com.git" - }, - "bugs": { - "url": "https://github.com/jquery/api.jquery.com/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/jquery/api.jquery.com/blob/master/LICENSE.txt" - } - ], + "version": "3.3.12", + "private": true, "scripts": { "test": "grunt lint" }, "dependencies": { - "grunt": "0.4.5", - "grunt-cli": "1.1.0", - "grunt-jquery-content": "3.0.1" + "grunt": "1.6.1", + "grunt-jquery-content": "3.3.2" } } diff --git a/pages/Ajax_Events.html b/pages/Ajax_Events.html index 26a59f0fd..6b1249be3 100644 --- a/pages/Ajax_Events.html +++ b/pages/Ajax_Events.html @@ -19,9 +19,9 @@

    Local Events

    Global Events

    These events are triggered on the document, calling any handlers which may be listening. You can listen for these events like so:

    -
     $(document).bind("ajaxSend", function(){
    +
     $(document).on("ajaxSend", function(){
        $("#loading").show();
    - }).bind("ajaxComplete", function(){
    + }).on("ajaxComplete", function(){
        $("#loading").hide();
      });
     
    diff --git a/pages/Types.html b/pages/Types.html index 5eb5eceb1..16a3a7c1b 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -1,6 +1,6 @@

    This page documents data types appearing in jQuery function signatures, whether defined by JavaScript itself or further restricted by jQuery. Unless explicitly stated otherwise, jQuery functions require primitive values where applicable, and do not accept their Object-wrapped forms. If you want to study these concepts in depth, take a look at MDN.

    -

    You should be able to try out most of the examples below by just copying them to your browser's JavaScript Console (Chrome, Safari with Develop menu activated, IE 8+) or Firebug console (Firefox). +

    You should be able to try out most of the examples below by just copying them to your browser's JavaScript Console.

    Whenever an example mentions that a type defaults to a boolean value, the result is good to know when using that type in a boolean context:

    @@ -101,11 +101,11 @@
  • Qunit's Assert Object
  • -

    Anything

    +

    Anything

    The Anything virtual type is used in jQuery documentation to indicate that any type can be used or should be expected.

    -

    String

    +

    String

    A string in JavaScript is an immutable primitive value that contains none, one or many characters.

    "I'm a String in JavaScript!"
    @@ -115,14 +115,14 @@ 

    String

    typeof "some string"; // "string"
     
    -

    Quoting

    +

    Quoting

    A string can be defined using single or double quotes. You can nest single quotes inside of double quotes, and the other way around. To mix double quotes with double quotes (or single with single), the nested ones have to be escaped with a backslash.

    "You make 'me' sad."
     'That\'s "cranking" good fun!'
     "<a href=\"home\">Home</a>"
     
    -

    Built-in Methods

    +

    Built-in Methods

    A string in JavaScript has some built-in methods to manipulate the string, though the result is always a new string - or something else, eg. split returns an array.

    "hello".charAt( 0 ) // "h"
    @@ -131,13 +131,13 @@ 

    Built-in Methods

    "hello".replace( /e|o/g, "x" ) // "hxllx" "1,2,3".split( "," ) // [ "1", "2", "3" ]
    -

    Length Property

    +

    Length Property

    All strings have a length property.

    "Hello".length // 5
     "".length // 0
     
    -

    Boolean Default

    +

    Boolean Default

    An empty string defaults to false:

    !"" // true
    @@ -147,9 +147,9 @@ 

    Boolean Default

    !new Boolean( false ) // false
    -

    htmlString

    +

    htmlString

    A string is designated htmlString in jQuery documentation when it is used to represent one or more DOM elements, typically to be created and inserted in the document. When passed as an argument of the jQuery() function, the string is identified as HTML if it starts with <tag ... >) and is parsed as such until the final > character. Prior to jQuery 1.9, a string was considered to be HTML if it contained <tag ... > anywhere within the string.

    -

    When a string as passed as an argument to a manipulation method such as .append(), it is always considered to be HTML since jQuery's other common interpretation of a string (CSS selectors) does not apply in those contexts.

    +

    When a string is passed as an argument to a manipulation method such as .append(), it is always considered to be HTML since jQuery's other common interpretation of a string (CSS selectors) does not apply in those contexts.

    For explicit parsing of a string to HTML, the $.parseHTML() method is available as of jQuery 1.8.

    // Appends hello:
     $( "hello" ).appendTo( "body" );
    @@ -166,7 +166,7 @@ 

    htmlString

    // Appends hellowaitbye: $( "hellowaitbye" ).appendTo( "body" );
    -

    Number

    +

    Number

    Numbers in JavaScript are double-precision 64-bit format IEEE 754 values. They are immutable primitive values, just like strings. All operators common in c-based languages are available to work with numbers (+, -, *, /, %, =, +=, -=, *=, /=, ++, --).

    12
    @@ -177,7 +177,7 @@ 

    Number

    typeof 12 // "number"
     typeof 3.543 // "number"
     
    -

    Boolean Default

    +

    Boolean Default

    If a number is zero, it defaults to false:

    !0 // true
    @@ -189,15 +189,13 @@ 

    Boolean Default

    0.1 + 0.2 // 0.30000000000000004
     
    -


    -

    -

    Math

    +

    Math

    JavaScript provides utilities to work with numbers in the Math object:

    Math.PI // 3.141592653589793
     Math.cos( Math.PI ) // -1
     
    -

    Parsing Numbers

    +

    Parsing Numbers

    parseInt and parseFloat help parsing strings into numbers. Both do some implicit conversion if the base isn't specified:

    parseInt( "123" ) = 123 // (implicit decimal)
    @@ -207,7 +205,7 @@ 

    Parsing Numbers

    parseInt( "11", 2 ) = 3 // (explicit binary) parseFloat( "10.10" ) = 10.1
    -

    Numbers to Strings

    +

    Numbers to Strings

    When appending numbers to string, the result is always a string. The operator is the same, so be careful: If you want to add numbers and then append them to a string, put parentheses around the numbers:

    "" + 1 + 2; // "12"
    @@ -220,7 +218,7 @@ 

    Numbers to Strings

    String( 1 ) + String( 2 ); // "12"
     String( 1 + 2 ); // "3"
     
    -

    NaN and Infinity

    +

    NaN and Infinity

    Parsing something that isn't a number results in NaN. isNaN helps to detect those cases:

    parseInt( "hello", 10 ) // NaN
    @@ -243,21 +241,19 @@ 

    NaN and Infinity

    Infinity === Infinity // true
     
    -

    Integer

    +

    Integer

    An integer is a plain Number type, but whenever explicitly mentioned, indicates that a non-floating-point number is expected.

    -

    Float

    +

    Float

    A float is a plain Number type, just as Integer, but whenever explicitly mentioned, indicates that a floating-point number is expected.

    -


    -

    -

    Boolean

    +

    Boolean

    A boolean in JavaScript can be either true or false:

    if ( true ) console.log( "always!" );
     if ( false ) console.log( "never!" );
     
    -

    Object

    +

    Object

    Everything in JavaScript is an object, though some are more objective (haha). The easiest way to create an object is the object literal:

    var x = {};
    @@ -270,7 +266,7 @@ 

    Object

    typeof {} // "object"
     
    -

    Dot Notation

    +

    Dot Notation

    You can write and read properties of an object using the dot notation:

    y.name // "Pete"
    @@ -278,7 +274,7 @@ 

    Dot Notation

    x.name = y.name + " Pan" // "Pete Pan" x.age = y.age + 1 // 16
    -

    Array Notation

    +

    Array Notation

    Or you write and read properties using the array notation, which allows you to dynamically choose the property:

    var operations = {
    @@ -289,7 +285,7 @@ 

    Array Notation

    operations[ operation ] // "++" operations[ "multiply" ] = "*"; // "*"
    -

    Iteration

    +

    Iteration

    Iterating over objects is easy with the for-in-loop:

    var obj = {
    @@ -300,7 +296,7 @@ 

    Iteration

    alert( "key is " + [ key ] + ", value is " + obj[ key ] ); }
    -

    Note that for-in-loop can be spoiled by extending Object.prototype (see Object.prototype is verboten) so take care when using other libraries. +

    Note that for-in-loop can be spoiled by extending Object.prototype (see Object.prototype is verboten) so take care when using other libraries.

    jQuery provides a generic each function to iterate over properties of objects, as well as elements of arrays:

    @@ -311,13 +307,13 @@

    Iteration

    The drawback is that the callback is called in the context of each value and you therefore lose the context of your own object if applicable. More on this below at Functions.

    -

    Boolean default

    +

    Boolean default

    An object, no matter if it has properties or not, never defaults to false:

    !{} // false
     !!{} // true
     
    -

    Prototype

    +

    Prototype

    All objects have a prototype property. Whenever the interpreter looks for a property, it also checks in the object's prototype if the property is not found on the object itself. jQuery uses the prototype extensively to add methods to jQuery instances. Internally, jQuery makes jQuery.fn an alias of jQuery.prototype so you can use either one (though plugin developers have standardized on fn).

    var form = $("#myform");
    @@ -336,7 +332,7 @@ 

    Prototype

    form.clearForm();
    -

    Array

    +

    Array

    Arrays in JavaScript are mutable lists with a few built-in methods. You can define arrays using the array literal:

    var x = [];
    @@ -352,7 +348,7 @@ 

    Array

    x[ 0 ] = 1;
     y[ 2 ] // 3
     
    -

    Iteration

    +

    Iteration

    An array has a length property that is useful for iteration:

    for ( var i = 0; i < a.length; i++ ) {
    @@ -402,13 +398,13 @@ 

    Iteration

    Note: .unshift() method does not return a length property in Internet Explorer.

    -

    Boolean Default

    +

    Boolean Default

    An array, no matter if it has elements or not, never defaults to false:

    ![] // false
     !![] // true
     
    -

    Array<Type> Notation

    +

    Array<Type> Notation

    In the jQuery API you'll often find the notation of Array<Type>:

    dragPrevention    Array<String>
    @@ -418,7 +414,7 @@ 

    Array<Type> Notation

    Array-Like Object

    Either a true JavaScript Array or a JavaScript Object that contains a nonnegative integer length property and index properties from 0 up to length - 1. This latter case includes array-like objects commonly encountered in web-based code such as the arguments object and the NodeList object returned by many DOM methods.

    When a jQuery API accepts either plain Objects or Array-Like objects, a plain Object with a numeric length property will trigger the Array-Like behavior.

    -

    PlainObject

    +

    PlainObject

    The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain object is, in other words, an Object object. It is designated "plain" in jQuery documentation to distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and host objects such as document, all of which have a typeof value of "object." The jQuery.isPlainObject() method identifies whether the passed argument is a plain object or not, as demonstrated below:

    
    @@ -438,7 +434,7 @@ 

    PlainObject

    Null

    The null keyword is a JavaScript literal that is commonly used to express the absence of an intentional value.

    -

    Date

    +

    Date

    The Date type is a JavaScript object that represents a single moment in time. Date objects are instantiated using their constructor function, which by default creates an object that represents the current date and time.

    
    @@ -450,7 +446,7 @@ 

    Date

    new Date( 2014, 0, 1, 8, 15 );
    -

    Function

    +

    Function

    A function in JavaScript can be either named or anonymous. Any function can be assigned to a variable or passed to a method, but passing member functions this way can cause them to be called in the context of another object (i.e. with a different "this" object).

    function named() {}
    @@ -459,7 +455,7 @@ 

    Function

    You see a lot of anonymous functions in jQuery code:

    $( document ).ready(function() {});
    -$( "a" ).click(function() {});
    +$( "a)" ).on( "click", function() {});
     $.ajax({
       url: "someurl.php",
       success: function() {}
    @@ -467,7 +463,7 @@ 

    Function

    The type of a function is "function".

    -

    Arguments

    +

    Arguments

    Inside a function a special variable "arguments" is always available. It's similar to an array in that it has a length property, but it lacks the built-in methods of an array. The elements of the pseudo-array are the argument of the function call.

    function log( x ) {
    @@ -482,7 +478,7 @@ 

    Arguments

    var awesome = function() { return arguments.callee; }
     awesome() === awesome // true
     
    -

    Context, Call and Apply

    +

    Context, Call and Apply

    In JavaScript, the variable "this" always refers to the current context. By default, "this" refers to the window object. Within a function this context can change, depending on how the function is called.

    All event handlers in jQuery are called with the handling element as the context. @@ -490,7 +486,7 @@

    Context, Call and Apply

    $( document ).ready(function() {
       // this refers to window.document
     });
    -$( "a" ).click(function() {
    +$( "a)" ).on( "click", function() {
       // this refers to an anchor DOM element
     });
     
    @@ -503,7 +499,7 @@

    Context, Call and Apply

    scope.call( "foobar", [ 1, 2 ] ); // "foobar", 1 scope.apply( "foobar", [ 1, 2 ] ); // "foobar", 2
    -

    Scope

    +

    Scope

    In JavaScript, all variables defined inside a function are only visible inside that function scope. Consider the following example:

    // global
    @@ -517,7 +513,7 @@ 

    Scope

    It defines a variable x in the global scope, then defines an anonymous function and executes it immediately (the additional parentheses are required for immediate execution). Inside the function another variable x is defined with a different value. It is only visible within that function and doesn't overwrite the global variable.

    -

    Closures

    +

    Closures

    Closures are created whenever a variable that is defined outside the current scope is accessed from within some inner scope. In the following example, the variable counter is visible within the create, increment, and print functions, but not outside of them.

    function create() {
    @@ -537,7 +533,7 @@ 

    Closures

    The pattern allows you to create objects with methods that operate on data that isn't visible to the outside—the very basis of object-oriented programming.

    -

    Proxy Pattern

    +

    Proxy Pattern

    Combining the above knowledge gives you as a JavaScript developer quite a lot of power. One way to combine that is to implement a proxy pattern in JavaScript, enabling the basics of aspect-oriented programming (AOP):

    (function() {
    @@ -551,10 +547,10 @@ 

    Proxy Pattern

    The above wraps its code in a function to hide the "proxied"-variable. It saves jQuery's setArray-method in a closure and overwrites it. The proxy then logs all calls to the method and delegates the call to the original. Using apply(this, arguments) guarantees that the caller won't be able to notice the difference between the original and the proxied method.

    -

    Callback

    +

    Callback

    A callback is a plain JavaScript function passed to some method as an argument or option. Some callbacks are just events, called to give the user a chance to react when a certain state is triggered. jQuery's event system uses such callbacks everywhere:

    -
    $( "body" ).click(function( event ) {
    +
    $( "body" ).on( "click", function( event ) {
       console.log( "clicked: " + event.target );
     });
     
    @@ -562,13 +558,13 @@

    Callback

    Some callbacks are required to return something, others make that return value optional. To prevent a form submission, a submit event handler can return false:

    -
    $( "#myform" ).submit(function() {
    +
    $( "#myform" ).on( "submit", function() {
       return false;
    -});
    +} );
     

    Instead of always returning false, the callback could check fields of the form for validity, and return false only when the form is invalid.

    -

    Error

    +

    Error

    An instance of an Error object is thrown as an exception when a runtime error occurs. Error can also be used as base to define user custom exception classes. In JavaScript an error can be thrown as shown below:

    throw new Error( "The argument provided is incorrect" );
    @@ -578,7 +574,7 @@ 

    Error

    var obj = null;
     console.log( obj.foo() );
     
    -

    Selector

    +

    Selector

    A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most cases, the DOM document present in all browsers, but can also be an XML document received via Ajax.

    The selectors are a composition of CSS and custom additions. All selectors available in jQuery are documented on the Selectors API page. @@ -600,7 +596,7 @@

    Event

    The standard events in the Document Object Model are: blur, focus, load, resize, scroll, unload, beforeunload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, and keyup. Since the DOM event names have predefined meanings for some elements, using them for other purposes is not recommended. jQuery's event model can trigger an event by any name on an element, and it is propagated up the DOM tree to which that element belongs, if any.

    -

    Element

    +

    Element

    An element in the Document Object Model (DOM) can have attributes, text, and children. It provides methods to traverse the parent and children and to get access to its attributes. Due to inconsistencies in DOM API specifications and implementations, however, those methods can be a challenge to use. jQuery provides a "wrapper" around those elements to help interacting with the DOM. But sometimes you will be working directly with DOM elements, or see methods that (also) accept DOM elements as arguments.

    Whenever you call jQuery's .each() method or one of its event methods on a jQuery collection, the context of the callback function — this — is set to a DOM element. @@ -615,7 +611,7 @@

    Element

    You could replace this.value with $(this).val() to access the value of the text input via jQuery, but in that case you wouldn't gain anything.

    -

    Text

    +

    Text

    Text is a node of the Document Object Model (DOM) that represents the textual content of an element or an attribute. Consider the following code:

    <p id="target"><b>Hello</b> world</p>
    @@ -625,7 +621,7 @@

    Text

    you obtain two children. The first one is the element representing the b tag. The second child is a text node containing the string " world".

    -

    jQuery

    +

    jQuery

    A jQuery object contains a collection of Document Object Model (DOM) elements that have been created from an HTML string or selected from a document. Since jQuery methods often use CSS selectors to match elements from a document, the set of elements in a jQuery object is often called a set of "matched elements" or "selected elements".

    The jQuery object itself behaves much like an array; it has a length property and the elements in the object can be accessed by their numeric indices [0] to [length-1]. Note that a jQuery object is not actually a Javascript Array object, so it does not have all the methods of a true Array object such as join(). @@ -642,20 +638,15 @@

    jQuery

    $( ".badEntry" ).css({ color: "red" });
     
    -

    XMLHttpRequest

    +

    XMLHttpRequest

    Some of jQuery's Ajax functions return the native XMLHttpRequest (XHR) object, or pass it as an argument to success/error/complete handlers, so that you can do additional processing or monitoring on the request. Note that Ajax functions only return or pass an XHR object when an XHR object is actually used in the request. For example, JSONP requests and cross-domain GET requests use a script element rather than an XHR object.

    -

    Although the XHR object is a standard, there are variations in its behavior on different browsers. Refer to the W3C site and browsers' documentation for more information: +

    Although the XHR object is a standard, there are variations in its behavior on different browsers. Refer to the WHATWG site and Mozilla Developer Network for more information:

    -
    • W3C standard -
    • Apple (Safari) -
    • Mozilla (Firefox) -
    • Microsoft (Internet Explorer) -
    • Opera + -

      Google does not appear to have an official page for their XHR documentation for Chrome. As of version 5, Chrome does not support the use of the file protocol for XHR requests. -

      -

      jqXHR

      +

      jqXHR

      As of jQuery 1.5, the $.ajax() method returns the jqXHR object, which is a superset of the XMLHTTPRequest object. For more information, see the jqXHR section of the $.ajax entry

      Thenable

      @@ -668,7 +659,9 @@

      Promise Object

      Callbacks Object

      A multi-purpose object that provides a powerful way to manage callback lists. It supports adding, removing, firing, and disabling callbacks. The Callbacks object is created and returned by the $.Callbacks function and subsequently returned by most of that function's methods.

      +

      Document

      +

      A document object created by the browser's DOM parser, usually from a string representing HTML or XML.

      XML Document

      A document object created by the browser's XML DOM parser, usually from a string representing XML. XML documents have different semantics than HTML documents, but most of the traversing and manipulation methods provided by jQuery will work with them.

      Assert

      -

      A reference to or instance of the object holding all of QUnit's assertions. See the API documentation for QUnit.assert for details.

      +

      A reference to or instance of the object holding all of QUnit's assertions. See the API documentation for QUnit.assert for details.

      diff --git a/redirects.json b/redirects.json index 2aa9b0565..ba33f9ddd 100644 --- a/redirects.json +++ b/redirects.json @@ -1,3 +1,4 @@ { - "/api/": "/resources/api.xml" + "/api/": "/resources/api.xml", + "/extending-ajax/": "/jQuery.ajax/#extending-ajax" } diff --git a/resources/events.js b/resources/events.js index e00efb363..9b01b7e6c 100644 --- a/resources/events.js +++ b/resources/events.js @@ -1,31 +1,31 @@ jQuery.print = function(message, insertionType) { - if (typeof(message) == 'object') { - var string = '{
      ', - values = [], - counter = 0; - $.each(message, function(key, value) { - if (value && value.nodeName) { - var domnode = '<' + value.nodeName.toLowerCase(); - domnode += value.className ? ' class="' + value.className + '"' : ''; - domnode += value.id ? ' id="' + value.id + '"' : ''; - domnode += '>'; - value = domnode; - } - values[counter++] = key + ': ' + value; - }); - string += values.join(',
      '); - string += '
      }'; - message = string; - } + if (typeof(message) == 'object') { + var string = '{
      ', + values = [], + counter = 0; + $.each(message, function(key, value) { + if (value && value.nodeName) { + var domnode = '<' + value.nodeName.toLowerCase(); + domnode += value.className ? ' class="' + value.className + '"' : ''; + domnode += value.id ? ' id="' + value.id + '"' : ''; + domnode += '>'; + value = domnode; + } + values[counter++] = key + ': ' + value; + }); + string += values.join(',
      '); + string += '
      }'; + message = string; + } - var $output = $('#print-output'); + var $output = $('#print-output'); - if ($output.length === 0) { - $output = $('